Image processing circuit, method, device and chip
Through the image processing circuit, bilateral filtering and high-pass filtering technology are used to adjust the blur and sharpening degree based on the edge distribution and grayscale value of pixel points, solving the problems of insufficient image clarity and edge sawtooth white edges, and achieving clearer image display.
Patent Information
- Application Number
- CN202510371144.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-07-11
AI Technical Summary
In image display technology, images captured by imaging systems have problems with insufficient clarity, and sharpening processing may lead to edge serrations and white edge effects.
Through the image processing circuit, the degree of blur and sharpening are controlled based on the edge distribution and grayscale value of pixel points. Bilateral filtering and high-pass filtering technology are used to adjust the pixel value to reduce noise and white edges.
Effectively reduce image noise and jagging, reduce white edge effect, and improve image clarity and edge sharpness.
Smart Images

Figure CN120298255A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of image display technology, and in particular to an image processing circuit, method, device and chip. Background Art
[0002] In the field of image display technology, the images captured by an imaging system may have problems with insufficient clarity. In some cases, the images can be sharpened to enhance the details and edges of the images and improve the clarity of the images. Summary of the Invention
[0003] Embodiments of the present application provide an image processing circuit, method, device and chip, which can be used to improve the clarity of images. The technical solutions are as follows:
[0004] On the one hand, embodiments of the present application provide an image processing circuit, and the circuit includes an input interface and a processor;
[0005] The input interface is used to obtain a first image, and the first image includes a plurality of pixel points and the pixel values of each pixel point among the plurality of pixel points;
[0006] The processor is used to obtain the edge distribution of any pixel point in the first image, determine the blur degree of any pixel point in the base layer based on the edge distribution and the pixel value of any pixel point, and / or determine the gray value of any pixel point based on the pixel value of any pixel point, and determine the sharpening degree of any pixel point in the mask layer based on the gray value of any pixel point;
[0007] The processor is further used to sharpen the pixel value of any pixel point based on at least one of the blur degree or sharpening degree of any pixel point to obtain the sharpened pixel value of any pixel point, and determine a second image corresponding to the first image based on the sharpened pixel values of each pixel point.
[0008] In a possible implementation manner, the processor is used to obtain the edge distribution of any pixel point and determine the first mask value of any pixel point in the mask layer based on the edge distribution;
[0009] The processor is further used to determine the value range weight of any pixel point based on the first mask value, and the value range weight represents the blur degree of any pixel point in the base layer.
[0010] In a possible implementation, the processor is configured to determine the high-frequency signal of a first image block in the first image. The first image block is obtained by dividing the first image. The first image block includes multiple pixel points and the pixel values of each pixel point in the first image. Any pixel point for which a first mask value is to be determined is located at the center of the first image block, and the high-frequency signal is correspondingly distributed in the edge region of the first image block;
[0011] The processor is further configured to determine the first mask value of any pixel point based on the high-frequency signal of the first image block.
[0012] In a possible implementation, the processor is configured to determine the gradient matrix of a second image block in the first image. The second image block is obtained by dividing the first image. The second image block includes multiple pixel points and the pixel values of each pixel point in the first image. Any pixel point for which a first mask value is to be determined is located at the center of the second image block, and the gradient matrix represents the edge region distributed in the second image block;
[0013] The processor is further configured to determine the first mask value of any pixel point based on the gradient matrix.
[0014] In a possible implementation, the processor is configured to determine at least one of the pixel distance of any pixel point or the range filtering radius of any pixel point based on the first mask value. The pixel distance is the difference in pixel values between any pixel point and other pixel points in the first image, and the range filtering radius represents the radius of the range filter kernel in bilateral filtering;
[0015] The processor is further configured to determine the range weight of any pixel point based on at least one of the pixel distance or the range filtering radius.
[0016] In a possible implementation, the processor is configured to add the first mask value and the pixel value of any pixel point to obtain an intermediate pixel value, and subtract the pixel value of other pixel points in the first image from the intermediate pixel value to obtain the pixel distance.
[0017] In a possible implementation, the range filtering radius is positively correlated with the first mask value.
[0018] In a possible implementation, the processor is configured to determine the brightness intensity based on the gray value of any pixel point and a reference value. The difference between the gray value and the reference value is negatively correlated with the brightness intensity, and the brightness intensity represents the sharpening degree of any pixel point in the mask layer.
[0019] In a possible implementation, the processor is configured to determine the degree of gray - value dispersion among multiple pixel points in a third image block based on the gray - value of any pixel point. The third image block is obtained by dividing the first image, and the third image block includes multiple pixel points in the first image and the pixel values of each pixel point. Any pixel point for which the sharpening degree is to be determined is located at the center of the third image block;
[0020] The processor is further configured to determine the edge intensity according to the degree of gray - value dispersion, where the edge intensity represents the sharpening degree of any pixel point in the mask layer.
[0021] In a possible implementation, the processor is configured to determine the degree of gray - value dispersion according to the gray - values of each pixel point in the third image block. The gray - values of each pixel point are determined based on the pixel values of each pixel point, and the degree of gray - value dispersion is positively correlated with the edge intensity.
[0022] In a possible implementation, the degree of blurring is represented by a range weight, and the degree of sharpening is represented by a brightness intensity and an edge intensity. The processor is configured to perform bilateral filtering on any pixel point based on the range weight of the any pixel point to obtain the basic pixel value of the any pixel point, and the basic pixel value is located in the basic layer;
[0023] The processor is further configured to obtain the second mask value of the any pixel point in the mask layer;
[0024] The processor is further configured to perform enhancement processing on the second mask value according to the brightness intensity and the edge intensity, and determine the sharpened pixel value of the any pixel point based on the enhanced second mask value and the basic pixel value.
[0025] In a possible implementation, the processor is configured to use the first mask value of the any pixel point as the second mask value.
[0026] On the other hand, a method for image processing is provided, and the method includes:
[0027] Obtain a first image, where the first image includes multiple pixel points and the pixel values of each pixel point among the multiple pixel points;
[0028] Obtain the edge distribution of any pixel point in the first image, determine the degree of blurring of any pixel point in the basic layer based on the edge distribution and the pixel value of any pixel point, and / or determine the gray - value of any pixel point based on the pixel value of any pixel point, and determine the sharpening degree of any pixel point in the mask layer based on the gray - value of any pixel point;
[0029] Sharpen the pixel value of any one of the pixel points based on at least one of the blurring degree or sharpening degree of any one of the pixel points to obtain the sharpened pixel value of any one of the pixel points, and determine the second image corresponding to the first image based on the sharpened pixel values of each pixel point.
[0030] In a possible implementation manner, the obtaining the edge distribution of any one of the pixel points in the first image and determining the blurring degree of any one of the pixel points in the base layer based on the edge distribution and the pixel value of any one of the pixel points includes:
[0031] Obtain the edge distribution of any one of the pixel points, and determine the first mask value of any one of the pixel points in the mask layer based on the edge distribution;
[0032] Determine the value range weight of any one of the pixel points based on the first mask value, and the value range weight represents the blurring degree of any one of the pixel points in the base layer.
[0033] In a possible implementation manner, the obtaining the edge distribution of any one of the pixel points and determining the first mask value of any one of the pixel points in the mask layer based on the edge distribution includes:
[0034] Determine the high-frequency signal of the first image block in the first image. The first image block is obtained by dividing the first image. The first image block includes multiple pixel points in the first image and the pixel values of each pixel point. Any one of the pixel points to determine the first mask value is located at the center of the first image block, and the high-frequency signal represents the edge region distributed in the first image block;
[0035] Determine the first mask value of any one of the pixel points based on the high-frequency signal of the first image block.
[0036] In a possible implementation manner, the obtaining the edge distribution of any one of the pixel points and determining the first mask value of any one of the pixel points in the mask layer based on the edge distribution includes:
[0037] Determine the gradient matrix of the second image block in the first image. The second image block is obtained by dividing the first image. The second image block includes multiple pixel points in the first image and the pixel values of each pixel point. Any one of the pixel points to determine the first mask value is located at the center of the second image block, and the gradient matrix represents the edge region distributed in the second image block;
[0038] Determine the first mask value of any one of the pixel points based on the gradient matrix.
[0039] In a possible implementation, determining the value range weight of any pixel point based on the first mask value includes:
[0040] Determining at least one of the pixel distance of any pixel point or the range filtering radius of any pixel point based on the first mask value, where the pixel distance is the difference in pixel values between any pixel point and other pixel points in the first image, and the range filtering radius is the radius of the value range filter kernel in bilateral filtering;
[0041] Determining the value range weight of any pixel point based on at least one of the pixel distance or the range filtering radius.
[0042] In a possible implementation, determining the pixel distance of any pixel point based on the first mask value includes:
[0043] Adding the first mask value and the pixel value of any pixel point to obtain an intermediate pixel value;
[0044] Subtracting the pixel value of other pixel points in the first image from the intermediate pixel value to obtain the pixel distance.
[0045] In a possible implementation, the range filtering radius is positively correlated with the first mask value.
[0046] In a possible implementation, determining the sharpening degree of any pixel point in the mask layer based on the gray value of any pixel point includes:
[0047] Determining the brightness intensity based on the gray value of any pixel point and a reference value, where the difference between the gray value and the reference value is negatively correlated with the brightness intensity, and the brightness intensity represents the sharpening degree of any pixel point in the mask layer.
[0048] In a possible implementation, determining the sharpening degree of any pixel point in the mask layer based on the gray value of any pixel point includes:
[0049] Determining the gray value dispersion degree among multiple pixel points in a third image block based on the gray value of any pixel point. The third image block is obtained by dividing the first image, and the third image block includes multiple pixel points in the first image and the pixel values of each pixel point. Any pixel point whose sharpening degree is to be determined is located at the center of the third image block;
[0050] Determining the edge intensity according to the gray value dispersion degree, where the edge intensity represents the sharpening degree of any pixel point in the mask layer.
[0051] In a possible implementation, determining the grayscale value of any pixel point based on the pixel value of any pixel point includes:
[0052] Determining the grayscale value of each pixel point according to the pixel values of the pixel points in the third image block;
[0053] Determining the degree of grayscale value dispersion among multiple pixel points in the third image block based on the grayscale value of any pixel point includes:
[0054] Determining the degree of grayscale value dispersion according to the grayscale values of the pixel points in the third image block, and the degree of grayscale value dispersion is positively correlated with the edge strength.
[0055] In a possible implementation, the degree of blurring is represented by a range weight, the degree of sharpening is represented by a brightness intensity and an edge strength, and sharpening the pixel value of any pixel point based on at least one of the degree of blurring or the degree of sharpening of any pixel point to obtain the sharpened pixel value of any pixel point includes:
[0056] Bilateral filtering any pixel point based on the range weight of any pixel point to obtain the basic pixel value of any pixel point, and the basic pixel value is located in the basic layer;
[0057] Obtaining the second mask value of any pixel point in the mask layer;
[0058] Performing enhancement processing on the second mask value according to the brightness intensity and the edge strength, and determining the sharpened pixel value of any pixel point based on the enhanced second mask value and the basic pixel value.
[0059] In a possible implementation, obtaining the second mask value of any pixel point in the mask layer includes:
[0060] Using the first mask value of any pixel point as the second mask value of any pixel point.
[0061] On the other hand, an electronic device is also provided. The device includes the image processing circuit described in any of the above, and a display panel for displaying the second image processed by the image processing circuit.
[0062] On the other hand, a display processing chip is provided, including the image processing circuit described in any of the above.
[0063] The technical solution provided by this application at least brings the following beneficial effects:
[0064] For any pixel, the blur degree in the base layer can be controlled based on the edge distribution of the pixel, and the blur degree of the pixels in the edge region can be adaptively adjusted according to the position of the pixel, so as to blur the jagged edges at the edges of the first image and reduce the noise of the image. Also, since the two sides of the edge in the first image are divided into a bright contrast edge and a dark contrast edge, and during the sharpening process, the gray value of the pixels located on the bright contrast edge may be amplified, resulting in a white edge at this edge. Considering that the gray value can reflect the possibility of any pixel being located on the bright contrast edge, the processor controls the sharpening degree of any pixel in the mask layer based on the gray value of the pixel, so as to adaptively adjust the sharpening degree of the pixels located on the bright contrast edge to reduce the white edge effect of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0066] Figure 1 is a sharpening comparison diagram provided by an embodiment of the present application;
[0067] Figure 2 is a schematic structural diagram of an image processing circuit provided by an embodiment of the present application;
[0068] Figure 3 is a schematic diagram of an image provided by an embodiment of the present application;
[0069] Figure 4 is a schematic diagram of an image block provided by an embodiment of the present application;
[0070] Figure 5 is a filtering diagram provided by an embodiment of the present application;
[0071] Figure 6 is another filtering diagram provided by an embodiment of the present application;
[0072] Figure 7 is a schematic diagram of a monotonically increasing curve provided by an embodiment of the present application;
[0073] Figure 8 is a schematic diagram of a mapping process provided by an embodiment of the present application;
[0074] Figure 9 is another schematic diagram of a mapping process provided by an embodiment of the present application;
[0075] Figure 10 is a noise reduction comparison diagram provided by an embodiment of the present application;
[0076] Figure 11 It is a comparison schematic diagram of anti-aliasing provided by an embodiment of the present application;
[0077] Figure 12 It is a process schematic diagram of edge enhancement provided by an embodiment of the present application;
[0078] Figure 13 It is a schematic diagram of reducing white edges provided by an embodiment of the present application;
[0079] Figure 14 It is a schematic diagram of a sharpening process provided by an embodiment of the present application;
[0080] Figure 15 It is a flowchart of an image processing method provided by an embodiment of the present application. Detailed implementation manners
[0081] To make the objectives, technical solutions and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0082] In the field of image display technology, due to many inevitable drawbacks, the images captured by various imaging systems may have problems of insufficient clarity. Therefore, the images can be processed to generate clearer details and edges to improve the clarity of the images. In some cases, the method of processing images includes sharpening the images. By sharpening, the pixel values of the pixel points in the images can be adjusted to amplify the brightness and color changes between the pixel points and improve the information transition at the boundaries of the images, thereby forming clear edges.
[0083] Optionally, the process of sharpening an image using an unsharp mask includes: generating a mask image I_mask = I - I_smooth based on the image, and obtaining the sharpened image e = I_smooth + k * I_mask using the mask image. Here, k is the sharpening degree, which can be called the sharpening intensity, I_smooth is the smoothed image obtained by performing low-pass filtering on the image I, and in some cases, it can be called the smooth layer and the base layer. I_smooth includes the low-frequency components of the image, such as the smooth regions in the image that are not edges. The mask image can be called the mask layer in some cases and includes the high-frequency components of the image, such as the edges, details, and noises in the image.
[0084] There are two reasons for generating the sharpening effect using the above method. The first is that overshoot and undershoot can be generated, and appropriate overshoot and undershoot can make the details stand out with a greater brightness than the original image, thereby highlighting the details of the image. The second is that the slope of the high-low transition can be increased, and by increasing the slope, the edge transition is intensified, thus playing a sharpening role visually.
[0085] Figure 1A sharpening contrast schematic diagram provided by an embodiment of the present application, which belongs to a horizontal cross-section of an image edge. Figure 1 The abscissa in it indicates the pixel points in the image, and each pixel point is a pixel point on a horizontal line in the image. The ordinate indicates the pixel value of the pixel point. Figure 1 The solid line in it indicates the distribution of pixel values before sharpening, and the dotted line indicates the distribution of pixel values after sharpening. By superimposing the input image and the mask image, the difference in pixel values of the pixel points at the edge becomes more obvious, and the edge transition is more intense. Moreover, since the mask image is superimposed on the input image, the pixel values at the junction of the input image will increase or decrease. Increasing the pixel value can cause overshoot as shown in Figure 1 shown, and decreasing the pixel value can cause undershoot as shown in Figure 1 shown. By increasing or decreasing the pixel values at the edge junction, the edge can be further highlighted, thereby strengthening the detailed part in the image.
[0086] However, although overshoot and undershoot can strengthen details, they will also produce a halo effect at the edge. The halo effect means that on both sides of the edge, there are dark contrast edges and bright contrast edges. The bright contrast edge can also be called a high-contrast edge. And during the sharpening process, it may cause the brightness of the bright contrast edge to be higher and the color to turn white, resulting in a white edge. Moreover, increasing the slope may magnify the degree of edge jaggedness in some cases.
[0087] Based on this, an embodiment of the present application provides an image processing circuit for controlling at least one of noise, jaggedness, or halo effect during the process of sharpening an image. Figure 2 A structural schematic diagram of an image processing circuit provided by an embodiment of the present application. The image processing circuit includes an input interface 11 and a processor 12. The input interface 11 and the processor 12 are connected.
[0088] Optionally, the input interface 11 is used to obtain a first image, and the first image includes a plurality of pixel points and the pixel values of each pixel point among the plurality of pixel points. The input interface 11 can receive the image collected by the image acquisition device and use the received image as the first image to be sharpened. The image acquisition device can be integrated with the image processing circuit on the same device. For example, if the image processing circuit is configured on a mobile phone, the image acquisition device can be the camera on the mobile phone. Or, the image acquisition device can also be configured on a different device from the image processing circuit. The image acquisition device can be called an image sensor, an imaging system, etc. in some cases.
[0089] Optionally, the first image can also be an image obtained by accessing the storage space. The storage space accessed can be the storage space of the device configured with the image processing circuit or the storage space of other devices. The first image can also be an image obtained by searching on the Internet.
[0090] The embodiments of the present application do not limit the type of the first image obtained by the input interface 11 either. It may be a color image or a grayscale image. When the first image is a color image, the color mode of the first image may be the RGB (Red-Green-Blue) mode, or the CMYK (Cyan Magenta Yellow Black) mode, or other modes. In addition, the first image may be a static image, for example, an image in the jpg (Joint Photographic Experts Group) format. The first image may also be one frame of a multi-frame image. The multi-frame image may be, for example, a dynamic image belonging to the gif (Graphics Interchange Format), or a video.
[0091] Regardless of the type of the first image, the first image includes a plurality of pixel points and the pixel values of each pixel point. Figure 3 It is a schematic diagram of a first image provided by the embodiments of the present application. Figure 3 In this figure, the first image includes 9×9 pixel points (i.e., 9 rows and 9 columns), and each pixel point has a corresponding pixel value. Optionally, the pixel value may be a single-channel luminance value. Taking the first image as an RGB image as an example, the pixel value may be the luminance value of the pixel point in the R channel, indicating the luminance of the red component, or the luminance value in the G channel, indicating the luminance of the green component, or the luminance value in the B channel, indicating the luminance of the blue component. Or, in the case where the first image is a grayscale image, the pixel value is the luminance value of the luminance channel, which may be referred to as the grayscale value in some cases. Exemplarily, the pixel value may also be a multi-channel luminance value, such as the luminance values of the RGB three channels.
[0092] In a possible case, after obtaining the first image, the image processing circuit may sharpen the pixel values of each pixel point through the processor 12. Herein, the processor 12 is, for example, an ISP (Image Signal Processor), and the processor 12 may also be other hardware or processing units capable of processing image signals. Since the process of sharpening different pixel points by the processor 12 is similar, hereinafter, taking one pixel point (hereinafter referred to as the first pixel point) in the first image as an example, the process of sharpening the pixel value of the pixel point will be exemplified.
[0093] Exemplarily, the processor 12 may sharpen the first pixel point by using an unsharp masking method. The formula of the unsharp masking method is v = v_smooth + k * v_mask, where v indicates the sharpened pixel value, v_smooth indicates the pixel value of the first pixel point in the base layer, which can be called the base pixel value, v_mask indicates the pixel value of the first pixel point in the mask layer, which can be called the mask pixel value, and k indicates the sharpening degree. Since the processor 12 may obtain the mask pixel value during the process of obtaining v_smooth, to distinguish the mask pixel values with two functions, the mask pixel value used to obtain v_smooth will be called the first mask value hereinafter, and v_mask will be called the second mask value.
[0094] Since v_smooth is a low-frequency signal obtained by filtering high-frequency signals, and noise and edges belong to high-frequency signals, therefore, the blurring degree of the first pixel point in the base layer can be obtained. The blurring degree represents the degree of filtering high-frequency signals during the process of obtaining v_smooth. By controlling the blurring degree, the noise or the sharpness of the edge can be controlled to avoid over-emphasizing the edge and causing jaggedness at the edge. In addition, since the reason for the white edge effect is the excessive strengthening degree of the bright contrast edge, therefore, the sharpening degree of the first pixel point in the mask layer can be obtained. The sharpening degree refers to the degree of strengthening the second mask value, so as to reduce the white edge effect by controlling the sharpening degree. Next, the processes for the processor 12 to obtain the blurring degree and the sharpening degree will be introduced separately.
[0095] Obtaining Process 1: The processor 12 obtains the edge distribution of the first pixel point in the first image, and determines the blurring degree of the first pixel point in the base layer based on the edge distribution and the pixel value of the first pixel point.
[0096] Among them, the edge distribution indicates the edge area corresponding to the first pixel point, which can be understood as the edge area in the image block where the first pixel point is located, and the center of the image block is the first pixel point. If the processor 12 smooths the pixel value of the first pixel point by using bilateral filtering to obtain v_smooth, the blurring degree determined by the processor 12 based on the edge distribution can be the value range weight during bilateral filtering. Among them, the formula of bilateral filtering is shown in Formula 1.
[0097]
[0098] r is the pixel value in the base layer, n is the size of the filter kernel. In the case where bilateral filtering acts on the image block, the pixel points included in the image block are n×n. [x0, y0] is the position coordinate of the central pixel point of the image block, and v[x0, y0] is the pixel value of the central pixel point. is the radius of the position filter kernel. is the radius of the range filter kernel. is the value range weight. is the position weight, which can be called the spatial domain weight.
[0099] Taking the bilaterally filtered image as Figure 4 an example of an image including 18×18 pixel points as shown, the central pixel point is the pixel point at the 3rd row and the 3rd column ( Figure 4 the circular mark in), x0 = 3, y0 = 3. When n is 5, the image block on which the bilateral filtering acts is shown in Figure 4 the dotted square box of. Based on the position coordinates and pixel values of each pixel point located in the 1st column to the 5th column and the 1st row to the 5th row, bilateral filtering is performed on the central pixel point, and the obtained filtering value is the pixel value of the central pixel point located in the smoothed base layer.
[0100] Blurring of the first image can be achieved through bilateral filtering. For example, edges are retained during the process of filtering the first image, and the slope of the edges is increased. So overall, the details of the first image are blurred, the edges are retained and the edges are slightly sharpened. In formula 1, the range weight of the bilateral filtering represents the degree of blurring and can protect the edges and details of the image during the bilateral filtering process. For example, for an image block located in the edge region, since the pixel values of each pixel point in the image block vary greatly, the range weight will suppress the pixel values with large differences, thereby protecting the edges from being blurred.
[0101] Exemplarily, the process of determining the range weight based on the edge distribution includes: after obtaining the edge distribution of the first pixel point, determining the first mask value of the first pixel point in the mask layer based on the edge distribution; determining the range weight of the first pixel point based on the first mask value. The processor 12 can determine the first mask value through including but not limited to the following two methods.
[0102] Method 1: Determine the high-frequency signal of the first image block in the first image. The first image block is obtained by dividing the first image. The first image block includes multiple pixel points in the first image and the pixel values of each pixel point. The first pixel point for which the first mask value is to be determined is located at the center of the first image block, and the high-frequency signal is correspondingly distributed in the edge region of the first image block; determine the first mask value of the first pixel point based on the high-frequency signal of the first image block.
[0103] Optionally, the first image block can be any image block centered on the first pixel point. The determination process of the first image block is similar to Figure 4 the determination process of the image block shown. The first image block can be an image block of any size. It can be an image block including 5×5 pixel points determined based on a 5×5 window, or an image block including 4×4 pixel points determined based on a 4×4 window, or an image block with unequal length and width, such as an image block including 9×11 pixel points.
[0104] If the first pixel is located at the boundary of the first image, since the window area will exceed the image area when taking the window area. For example, taking the pixel at the first row and the first column shown in Figure 4 as the first pixel, the window area taken with the first pixel as the center will exceed the image area. In such a case, the processor 12 can perform a filling process to obtain a first image block centered on the first pixel located at the boundary. The filling method is, for example, mirror filling.
[0105] Figure 5 is a schematic diagram of filtering provided by an embodiment of the present application. Figure 5 The first image block in Figure 5 includes 5×5 pixels, and the pixel value of each pixel is as shown in
[0106] The processor 12 first transforms the first image block to the frequency domain through Fourier transform, then filters the low-frequency signals in the frequency domain to obtain the high-frequency signals of the first image block. The high-frequency signals can represent the edge distribution. Then, the processor 12 transforms the filtered high-frequency signals from the frequency domain back to the spatial domain, and determines the first mask value of the first pixel based on the transformation result. For example, the pixel value at the center of the transformation result is extracted as the first mask value of the first pixel.
[0107] Among them, the gray value of the edge part of the first image block changes violently, corresponding to the high-frequency signals, and the non-edge area corresponds to the low-frequency signals. By filtering out the low-frequency signals in the first image block and retaining the high-frequency signals in the first image block, the non-edge area of the first image block can be weakened to highlight the edge area.
[0108] Method 2: Determine the gradient matrix of the second image block in the first image. The second image block is obtained by dividing the first image. The second image block includes multiple pixels in the first image and the pixel values of each pixel. The first pixel for which the first mask value is to be determined is located at the center of the second image block. The gradient matrix represents the edge area distributed in the second image block; determine the first mask value of the first pixel based on the gradient matrix.
[0109] Optionally, the determination process of the second image block is similar to that of the first image block. For relevant descriptions, refer to the relevant descriptions and will not be repeated here. The size of the second image block and the size of the first image block can be the same or different. Taking the first image block as the Figure 5 5×5 image block shown in Figure 5 as an example, the second image block can be the Figure 6 image block shown in
[0110] In some cases, the processor 12 can perform high-pass filtering on the second image block to obtain a first mask value. It can be understood that during the high-pass filtering process of the high-frequency signal of the second image block, the processor 12 will determine the gradient matrix of the second image block and output the high-pass filtered value as the first mask value based on the gradient matrix. Among them, the high-pass filtering can be LoG (Laplacian of Gaussian) filtering, or other filtering methods.
[0111] Taking LoG filtering as an example, the processor 12 first obtains a LoG filtering template, which includes the filtering weights of each pixel point in the first image block. The filtering weight of any pixel point is determined based on the coordinate distance between any pixel point and the first pixel point. For example, the greater the coordinate distance between any pixel point and the first pixel point, the smaller the filtering weight of that pixel point.
[0112] After that, the LoG filtering template is multiplied by the pixel values of each pixel point in the first image block to obtain the gradient matrix of the first image block. The gradient matrix includes multiple gradients of the first pixel point, and different gradients are the gradients of the first pixel point relative to different pixel points in the second image block. Then, the processor 12 adds up the gradients in the gradient matrix to obtain the high-pass filtered value of the first pixel point. The above process can be understood as convolution based on the high-pass filtering template and the pixel values of each pixel point in the second image block. In some cases, the high-pass filtered value can also be called the frequency domain intensity.
[0113] In some cases, the processor 12 can also perform edge detection filtering on the second image block to obtain a first mask value. It can be understood that during the edge detection filtering process of the high-frequency signal of the second image block, the processor 12 will determine the gradient matrix of the second image block and determine the edge detection filtered value obtained by edge detection filtering as the first mask value based on the gradient matrix. Among them, the edge detection filtering can be implemented by the Sobel operator, or other filtering operators can be used.
[0114] Taking the Sobel operator as an example, the processor 12 multiplies the second image block with two Sobel filtering templates to obtain two gradient matrices, which are the horizontal gradient matrix and the vertical gradient matrix respectively. The horizontal gradient matrix includes multiple horizontal gradients of the first pixel point, and the vertical gradient matrix includes multiple vertical gradients of the first pixel point. Then, the processor 12 determines the edge detection filtered value of the first pixel point based on the horizontal gradient matrix and the vertical gradient matrix, such as determining the sum of the squares of the horizontal gradient matrix and the vertical gradient matrix or adding the absolute values of the horizontal gradient matrix and the vertical gradient matrix. Optionally, the edge detection filtered value can also be called the gradient intensity.
[0115] Regardless of the gradient matrix, the edge distribution of the second image block can be reflected. Since any gradient included in the gradient matrix reflects the change rate of the pixel value of the first pixel point relative to any pixel point, and the pixel values in the edge area change violently, with a large change rate and a large gradient, while the pixel values in the non-edge area change slowly, with a small change rate and a small gradient. Therefore, if the gradient of the first pixel point relative to any pixel point is larger, it indicates that the pixel point and the first pixel point are more likely to be distributed on both sides of the edge.
[0116] Optionally, the processor 12 can execute only method one, or only method two, or execute both method one and method two. Regardless of the method based on which the processor 12 obtains the first mask value of the first pixel point, the value range weight of the first pixel point can be determined based on the first mask value. Referring to Equation 1, since the value range weight is determined based on the pixel distance and the range filtering radius, the processor 12 can determine at least one of the pixel distance or the range filtering radius based on the first mask value. The pixel distance is the difference in pixel values between any pixel point and other pixel points in the first image, and the range filtering radius represents the radius of the value range filter kernel in the bilateral filtering; the value range weight of any pixel point is determined based on at least one of the pixel distance or the range filtering radius.
[0117] Next, taking the multiple first mask values obtained by the processor 12 executing method two as the high-pass filter value and the edge detection filter value respectively as an example, the processes of determining the pixel distance and the range filtering radius will be introduced separately.
[0118] Determination process one: The processor 12 adds the first mask value and the pixel value of the first pixel point to obtain an intermediate pixel value, and subtracts the pixel value of other pixel points in the first image from the intermediate pixel value to obtain the pixel distance.
[0119] The process by which the processor 12 obtains the intermediate pixel value can be referred to Equation 2.
[0120] v_adap[x0,y0] = v[x0,y0] + LoG(x,y) (Equation 2)
[0121] Among them, v_adap[x0,y0] is the intermediate pixel value, v[x0,y0] is the pixel value, and LoG(x,y) is the high-pass filter value. As shown by the processor 12, Figure 5 after filtering to obtain the high-pass filter value LoG(x,y) in method two, LoG(x,y) and v[x0,y0] are added to obtain v_adap[x0,y0].
[0122] After determining the intermediate pixel value v_adap[x0,y0], the processor 12 can replace v[x0,y0] in Formula 1 with the intermediate pixel value v_adap[x0,y0]. Subsequently, during the execution of bilateral filtering, the pixel values of other pixel points in the image block are subtracted from the intermediate pixel value to obtain the pixel distance. In addition, since the image block also includes the first pixel point, the processor 12 can choose to calculate the pixel point difference between the first pixel point and the pixel points between the first pixel points, or can choose not to calculate the pixel point difference between the first pixel point and the pixel points between the first pixel points.
[0123] Since the high-pass filtering value is the high-frequency signal of the first pixel point, adding the high-pass filtering value and the pixel value, the obtained intermediate pixel value highlights the edge of the first pixel point, which belongs to the first pixel point after edge enhancement. The purpose of sharpening the first image is to highlight the edge of the first image. Therefore, the intermediate pixel value can reflect the sharpening direction of the pixel point. Determining the pixel distance based on the intermediate pixel value can make the bilateral filtering proceed in the sharpening direction to better retain edge information while reducing noise.
[0124] Determination process two: The processor 12 determines the range filtering radius based on the first mask value, and the range filtering radius is positively correlated with the first mask value.
[0125] Exemplarily, after the processor 12 executes Method 2 to determine the edge detection filtering value, it can determine the range filtering radius based on the edge detection filtering value. For example, a monotonically increasing curve is used to map the edge detection filtering value to obtain the range filtering radius σ_adap r [x0,y0]. Since the edge detection filtering value is filtered based on the edge detection result, the larger the edge detection filtering value, the more likely it is that the second image block is an edge area, and the more likely the first pixel point located at the center of the second image block is located at the edge. Through the monotonically increasing curve, the range filtering radius can be increased at the edge to improve the blurring degree at the edge, thereby reducing edge jagging.
[0126] Optionally, the monotonically increasing curve can be set based on experience. See Figure 7 , the abscissa of the monotonically increasing curve is the sobel filtering value, and the ordinate is σ_adap r . The processor 12 can be as Figure 7 The dotted line example in shows that the edge detection filtering value obtained by filtering is located on the abscissa of the monotonically increasing curve, and the corresponding ordinate is used as the range filtering radius σ_adap r [x0,y0].
[0127] If the processor 12 executes the determination process one and the determination process two, the pixel distance can be directly divided by the range filtering radius to obtain the value domain weight. For example, replace v[x0,y0] in Formula 1 with the intermediate pixel value v_adap[x0,y0], and replace σ r [x0,y0] in Formula 1 with the range filtering radius σ_adap r , and obtain Formula 3 as shown below.
[0128]
[0129] The meanings of the various parameters in Formula 3 are similar to those in Formula 1. v_adap[x0,y0] is the intermediate pixel value determined based on the sharpening direction, v[x,y] - v_adap[x0,y0] is the pixel distance between other pixel points in the image block and the first pixel point, and σ_adap r is the range filtering radius determined based on the sharpening direction. Divide the pixel distance by the range filtering radius using Formula 3 to obtain the value domain weight
[0130] If the processor 12 executes any one of the determination process one or the determination process two, for the undetermined parameters, the original parameters can be used for calculation. Taking the case where the processor 12 executes the determination process two as an example, the processor 12 calculates the range filtering radius σ_adap r , but the intermediate pixel value of the first pixel point is not determined. In this case, the processor 12 can use the initial pixel value of the first pixel point, which can be understood as the pixel value of the first pixel point in the first image, to calculate the pixel distance, and then divide the pixel distance by the range filtering radius to obtain the value domain weight.
[0131] In addition, the above examples are intended to illustrate the process of determining the value domain weight through the first mask value, rather than limiting the filtering method. In addition to using the high-pass filter value to determine the intermediate pixel value as shown in the above embodiments, the high-pass filter value can also be used to determine the range filtering radius, and the edge detection filter value can also be used to determine the intermediate pixel value.
[0132] Obtaining process two: The processor 12 determines the gray value of the first pixel point based on the pixel value of the first pixel point, and determines the sharpening degree of the first pixel point in the mask layer based on the gray value of the first pixel point.
[0133] Optionally, the processor 12 may determine the grayscale value gray of the first pixel point based on the pixel value of the first pixel point. If the first image is a multi-channel image, the grayscale value may be obtained by performing multi-channel normalization on the pixel value of the first pixel point, and the grayscale value may also be the maximum value on each channel. If the first image is a grayscale image, the pixel value of the first pixel point may be directly used as the grayscale value of the first pixel point. After obtaining the grayscale value of the first pixel point, the processor 12 may determine the sharpening degree in the following two ways, including but not limited to these.
[0134] Among them, the grayscale value is used to describe the brightness of the first pixel point and reflects the probability that the first pixel point is located at the bright contrast edge of the edge. For example, the larger the grayscale value of the first pixel point, the more likely the first pixel point is located at the bright contrast edge in the first image. The processor 12 may determine the sharpening degree based on the grayscale value in the following two ways, including but not limited to these.
[0135] Determination method 1: Determine the brightness intensity based on the grayscale value of the first pixel point and the reference data. The difference between the grayscale value and the reference value is negatively correlated with the brightness intensity, and the brightness intensity represents the sharpening degree of the first pixel point in the mask layer.
[0136] Since there is a lot of noise in the areas with low grayscale values (the image is darker), the sharpening degree can be reduced for the areas with low grayscale values to reduce the amplification of the grayscale value of this pixel point and avoid amplifying the noise. And if the grayscale value of the first pixel point is too high, this first pixel point may be located at the bright contrast edge of the image edge. In this case, if the grayscale value is blindly increased, white edges may appear at the edge. Therefore, the sharpening degree can be reduced for the areas with higher grayscale values to reduce the amplification of the grayscale value of the first pixel point and avoid the white edge problem. The processor 12 may determine the high or low of the grayscale value based on the reference value. The reference value may be any positive integer or a numerical range.
[0137] Taking the reference value as a numerical range as an example, the processor 12 may map the grayscale value into the brightness intensity str using a trapezoidal curve luma , and the trapezoidal curve may be any trapezoid. This brightness intensity determines the sharpening degree of the mask layer. Figure 8 This is a mapping schematic diagram provided by an embodiment of this application. Figure 8 In the gradient curve in, the abscissa is the grayscale value gray, and the ordinate is str lUua . Refer to Figure 8 . For the first pixel point with the position coordinate (0, 0), after determining the grayscale value Gray(x, y) based on the pixel value V 0,0 of this first pixel point, Gray(x, y) can be located on the abscissa axis of the gradient curve, and the corresponding ordinate is used as the brightness intensity.
[0138] Determination method 2: Determine the gray value dispersion degree among multiple pixel points in the third image block based on the gray value of the first pixel point. The third image block is obtained by dividing the first image. The third image block includes multiple pixel points in the first image and the pixel values of each pixel point. The first pixel point whose sharpening degree is to be determined is located at the center of the third image block; determine the edge intensity according to the gray value dispersion degree, and the edge intensity represents the sharpening degree of the first pixel point in the mask layer.
[0139] Optionally, the process of obtaining the third image block is similar to the process of obtaining the first image block. For details, refer to the relevant description and will not be repeated here. For the case where in determination method 2, the processor 12 needs to determine the gray value dispersion degree according to the gray values of each pixel point in the third image block, and the gray values of each pixel point are determined based on the pixel values of each pixel point. In addition to determining the gray value of the first pixel point located at the center in the third image block, the processor 12 also determines the gray values of other pixel points. For example, the processor 12 directly determines the gray values of each pixel point in the third image block.
[0140] After the processor 12 obtains the gray values of each pixel point, it can determine the gray value dispersion degree of the third image block according to the gray values of each pixel point. The gray value dispersion degree is positively correlated with the edge intensity. Exemplarily, the processor 12 can calculate the standard deviation of the gray values of each pixel point and use the standard deviation as the gray value dispersion degree. Other calculation methods can also be used.
[0141] If the gray value dispersion degree is high, it indicates that the gray values in the third image block change violently, and the probability that the third image block is an edge area is high. The first pixel point located at the center of the third image block has a greater probability of being on the edge, and the sharpening degree can be increased to highlight the edge. If the gray value dispersion degree is low, it indicates that the gray values in the third image block do not change violently, and the probability that the third image block is an edge area is low. The probability that the first pixel point located at the center of the third image block is on the edge is low, and the sharpening degree can be reduced to further exacerbate the contrast with the edge area to highlight the edge in the first image. Based on the positive correlation relationship between the above gray value dispersion degree and the sharpening degree, after calculating the gray value dispersion degree, the processor 12 can use a monotonically increasing curve to map the gray value dispersion degree into the edge intensity to obtain the edge intensity that is positively correlated with the gray value dispersion degree.
[0142] Optionally, the monotonically increasing curve can be set based on experience and the implementation environment, such as the ISO (International Organization for Standardization) sensitivity of the illumination condition of the first image. In the case of better illumination conditions and smaller ISO sensitivity, the original noise in the first image is smaller. Therefore, the increasing amplitude of the monotonically increasing curve is small and tends to be a horizontal line. In the case of poorer illumination conditions and larger ISO sensitivity, the original noise in the first image is larger, and the light near the light source is also easily enhanced by the mask layer. Therefore, the increasing amplitude of the monotonically increasing curve is large to weaken the sharpening degree at the lower edge intensity.
[0143] Figure 9 A mapping schematic diagram provided by an embodiment of the present application Figure 9 The third image block in it includes 5×5 pixel points, and the position coordinates of the first pixel point are (0, 0). Figure 9 The abscissa of the monotonic mapping curve in it is the standard deviation std, and the ordinate is the edge intensity str_edge. As Figure 9 shown, after the processor 12 calculates the standard deviation of each gray value in the third image block to obtain Std(x, y), it locates Std(x, y) on the abscissa axis of the monotonically increasing curve, and takes the ordinate corresponding to the located abscissa as the edge intensity of the pixel point with the position coordinates (0, 0).
[0144] The processor 12 can selectively execute one or more of the acquisition process one and the acquisition process two to obtain at least one of the blurring degree or the sharpening degree. Thus, in the process of sharpening the first image, noise reduction, anti-aliasing, or white edge reduction and other effects can be achieved based on at least one of the blurring degree or the sharpening degree.
[0145] Exemplarily, the processor 12 can sharpen the pixel value of the first pixel point based on at least one of the blurring degree or the sharpening degree of the first pixel point to obtain the sharpened pixel value of the first pixel point, and determine the second image corresponding to the first image based on the sharpened pixel values of each pixel point. For example, determine the basic pixel value of the first pixel point based on the blurring degree, strengthen the second mask value of the first pixel point based on the sharpening degree, and determine the sharpened pixel value of the first pixel point based on the basic pixel value and the strengthened second mask value.
[0146] Next, taking the processor 12 determining the intermediate pixel value, the range filtering radius, the sharpening degree, and the edge intensity as an example, the process of sharpening the first image to obtain the second image is illustrated.
[0147] For the intermediate pixel value and the range filtering radius, the processor 12 can be used in the process of bilateral filtering. For example, the difference between the pixel values of other pixel points in the fourth image block and the intermediate pixel value of the first pixel point is determined as the pixel distance between the other pixel points and the first pixel point, and the fourth image block is the image block with the first pixel point at the center in the first image; based on the range filtering radius and each pixel distance, the value range weight corresponding to the first pixel point is determined.
[0148] The description of the fourth image block is similar to the description of the image block involved in Formula 1, and the relevant description can be referred to and will not be elaborated here. The size of the fourth image block can be the same as or different from the sizes of the first image block and the second image block. It can be understood that the fourth image block only needs to ensure that the central pixel point is the same as that of the first image block and the second image block, both being the first pixel point, so that the intermediate pixel value determined based on the first image block and the range filtering radius determined based on the second image block can be used for bilateral filtering.
[0149] Among them, the process of bilateral filtering of the fourth image block can be referred to Formula 3. Continuing to use the first pixel point located at the center of the fourth image block as the pixel point located at (0, 0) in the above embodiment, if n in Formula 3 is 5, the structure of the fourth image block is as Figure 5 shown. For the pixel point at the first row and the first column in the fourth image block with the position coordinates of (-2, -2), the processor 12 first calculates the difference between the pixel value v[-2, -2] of this pixel point and the intermediate pixel value v_adap[x0, y0] to obtain the pixel distance (v[-2, -2] - v_adap[x0, y0]) between the two pixel points. Based on the pixel distance and the range filtering radius, the value range weight is calculated Multiply the value range weight and the position weight, and the obtained product is
[0150] The processor 12 performs the above similar operations on each pixel point in the fourth image block, adds the products calculated based on each pixel point, and obtains the basic pixel value of the first pixel point located at the center. Based on Formula 3 and Formula 1, it can be known that what the processor 12 improves in the process of bilateral filtering is the value range weight, and for the position weight it is not adjusted.
[0151] For the bilateral filtering based on Formula 3 above, the intermediate pixel value can control the noise in the image. It can be understood that controlling the LoG intensity can control the noise in the image. For example Figure 10 shown, Figure 10 The left figure of is the image obtained by bilateral filtering according to Formula 1 in the related art, Figure 10 The right figure of is the image obtained by bilateral filtering based on the intermediate pixel value. Compared with the related art, the present application effectively reduces the noise.
[0152] The range filtering radius can control the jaggedness in the image. For example Figure 11 as shown Figure 11 Both of the two figures in [[ ]] are obtained by superimposing the base layer obtained based on bilateral filtering and the sharpened mask layer Figure 11 In the left figure of [[ ]], the base layer is obtained based on the bilateral filtering shown in Formula 1 Figure 11 In the right figure of [[ ]], the base layer is obtained by performing bilateral filtering based on the range filtering radius. Compared with the related art, the present application effectively improves the jaggedness degree in the image
[0153] Optionally, in addition to blurring the first pixel point in the base layer, the processor 12 also sharpens the first pixel point in the mask layer. The sharpening process is, for example: obtaining the second mask value of the first pixel point in the mask layer; strengthening the second mask value according to the brightness intensity and edge intensity
[0154] Exemplarily, the processor 12 can perform high-frequency enhancement filtering on the high-frequency signal of the first pixel point by using any high-frequency enhancement filter to obtain the second mask value. The high-frequency enhancement filter includes a high-pass filter or an edge detection filter. The filtering process can refer to the description of Method 1 or Method 2. Among them, the high-pass filter can be a high-pass filter different from the one for determining the intermediate pixel value, or the same filter. If the processor 12 determines the intermediate pixel value and the first mask value of the same pixel point based on the same filter, the processor 12 can perform one filtering and directly use the first mask value as the second mask value to be strengthened
[0155] Since the second mask value is located in the mask layer and carries the image details and edges of the first pixel point, by adding the second mask value and the base pixel value, the image details and edges of the first pixel point can be highlighted to achieve the sharpening of the pixel point. For example Figure 12 , Figure 12 In (1) and (3) of [[ ]], the abscissa is the pixel point and the ordinate is the pixel value Figure 12 In (2) of [[ ]], the abscissa is the pixel value and the ordinate is the intensity of the high-frequency signal
[0156] Figure 12 (1) of [[ ]] shows the transition situation at the edge in the image before sharpening Figure 12 (2) of [[ ]] shows the mask layer obtained by filtering based on the high-pass filter Figure 12 (3) of [[ ]] shows the transition situation at the edge in the image after sharpening. By sharpening in the mask layer, edge enhancement can be achieved
[0157] In some cases, before superimposing the second mask value and the base pixel value, the processor 12 may enhance the second mask value based on the luminance intensity and the edge intensity. For example, multiplying the luminance intensity, the edge intensity, and the second mask value, and using the product as the enhanced second mask value. After that, the processor 12 adds the enhanced second mask value and the base pixel value to obtain the sharpened pixel value of any pixel point. The above process can be seen in Equation 4.
[0158] v sharpen =v base +v mask *str edge *str luma (Equation 4)
[0159] In Equation 4, v sharpen indicates the sharpened pixel value, v base indicates the base pixel value, v mask indicates the second mask value, str edge indicates the edge intensity, str luma indicates the luminance intensity. The processor 12 can perform the above sharpening operation on each pixel point in the first image to obtain the sharpened pixel value of each pixel point, and then adjust the pixel value of each pixel point in the first image to the sharpened pixel value to obtain the second image.
[0160] Enhancing the second mask value by the luminance intensity and the edge intensity can effectively reduce the white edges in the second image. Figure 13 This is a comparative schematic diagram of sharpening an image provided by an embodiment of the present application. Figure 13 The left figure of Figure 13 is the first image sharpened by the unsharp mask method, Figure 13 and the right figure of
[0161] is the second image obtained after enhancing the second mask value based on the luminance intensity and the edge intensity. Referring to
[0162] Next, take Figure 14For example, the process of obtaining various parameters during the sharpening of the first image by the image processing circuit will be illustrated. For the input first image, in the "sliding window" manner, each pixel point in the first image is scanned in sequence (from top to bottom, from left to right). For each pixel point, a window area of 5*5 size is taken with it as the center. In each sliding window, the steps of filtering the central pixel point include:
[0163] Step1. Filter the 5x5 window using a LoG filter, add the high-pass filtered value obtained by filtering to the central pixel value to obtain an adaptive pixel value v_adap. Among them, the central pixel value corresponds to the pixel value of the first pixel point located in the center in the above embodiment, and the adaptive pixel value corresponds to the intermediate pixel value in the above embodiment.
[0164] Step2. Filter the 3x3 window using a Sobel filter, and map the obtained edge detection filtered value to an adaptive radius σ_adap through a monotonically increasing curve r , and the adaptive radius corresponds to the range filtering radius in the above embodiment.
[0165] Step3. Improve the bilateral filter shown in Formula 1 with the adaptive pixel value and adaptive radius obtained in Step1 and Step2 to obtain the adaptive bilateral filter shown in Formula 3, and use the adaptive bilateral filter shown in Formula 3 to filter the 5x5 window to obtain a basic pixel value v base . Through adaptive filtering processing, the filtering degrees of the flat area and the edge area are respectively controlled, thereby controlling the image noise and the jagged intensity.
[0166] Step4. Use the filtering result of the LoG filter belonging to the high-pass filter as the mask pixel value v mask , and the mask pixel value corresponds to the second mask value in the above embodiment.
[0167] Step5. Calculate the standard deviation std within the 5x5 window, and map the standard deviation to the edge intensity str through a monotonically increasing curve edge .
[0168] Step6. Calculate the gray value gray of the central pixel point in the 5x5 window, and map the gray value to the brightness intensity str through a trapezoidal curve luma .
[0169] Step7. Multiply the mask pixel value by the edge intensity and the brightness intensity, and add the basic pixel value v base to obtain the final sharpened image v sharpen. Implement unsharp masking image sharpening based on grayscale and edges, improving image sharpness while suppressing the white edge effect.
[0170] In summary, the image processing circuit provided by the embodiments of the present application can control the blurring degree of the basic layer based on the edge distribution of any pixel point, adaptively adjust the blurring degree of the pixel points located in the edge area based on the position of the pixel point, thereby blurring the jagged edges at the edges of the first image and reducing the noise of the image. For the case where the grayscale value can reflect the possibility of any pixel point being located at a bright contrast edge, the processor 12 controls the sharpening degree of any pixel point in the mask layer based on the grayscale value of any pixel point, thereby adaptively adjusting the sharpening degree of the pixel points located at the bright contrast edge to reduce the white edge effect of the image. The present application does not limit the parameters used in the process of sharpening the first image, which can be one or more of the intermediate pixel value, range filter radius, edge intensity or brightness intensity, with high flexibility. Different problems that may occur in the process of sharpening the first image can be optimized based on different parameters, including but not limited to noise, jagged edges or white edges, etc., with wide generality.
[0171] The embodiments of the present application also provide an image processing method, and the flowchart of this method is as Figure 15 shown, including step 1501 - step 1503.
[0172] In step 1501, obtain a first image, where the first image includes a plurality of pixel points and the pixel values of each pixel point among the plurality of pixel points.
[0173] Exemplarily, the process of obtaining the first image and Figure 2 the process of the image processing circuit shown in obtaining the first image are similar, and reference can be made to the relevant description, which will not be repeated here.
[0174] In step 1502, obtain the edge distribution of any pixel point in the first image, determine the blurring degree of any pixel point in the basic layer based on the edge distribution and the pixel value of any pixel point, and / or determine the grayscale value of any pixel point based on the pixel value of any pixel point, and determine the sharpening degree of any pixel point in the mask layer based on the grayscale value of any pixel point.
[0175] Optionally, the process of determining the blurring degree includes: obtaining the edge distribution of any pixel point, determining the first mask value of any pixel point in the mask layer based on the edge distribution; determining the value range weight of any pixel point based on the first mask value, and the value range weight represents the blurring degree of any pixel point in the basic layer.
[0176] The process of obtaining the edge distribution to determine the first mask value may be as follows: Determine the high-frequency signal of the first image block in the first image. The first image block is obtained by dividing the first image. The first image block includes multiple pixel points in the first image and the pixel values of each pixel point. Any pixel point for which the first mask value is to be determined is located at the center of the first image block, and the high-frequency signal is correspondingly distributed in the edge region of the first image block; Determine the first mask value of any pixel point based on the high-frequency signal of the first image block.
[0177] Optionally, the process of determining the first mask value may also be as follows: Determine the gradient matrix of the second image block in the first image. The second image block is obtained by dividing the first image. The second image block includes multiple pixel points in the first image and the pixel values of each pixel point. Any pixel point for which the first mask value is to be determined is located at the center of the first image block, and the gradient matrix represents the edge region distributed in the second image block; Determine the first mask value of any pixel point based on the gradient matrix. For the detailed process, refer to Figure 2 the relevant descriptions of Method 1 and Method 2 in the embodiments shown, and will not be repeated here.
[0178] Exemplarily, after determining the first mask value, the value range weight of any pixel point may be determined. Based on the first mask value, at least one of the pixel distance of any pixel point or the range filtering radius of any pixel point is determined. The pixel distance is the difference in pixel values between any pixel point and other pixel points in the first image, and the range filtering radius is the radius of the value range filter kernel in bilateral filtering; Determine the value range weight of any pixel point based on at least one of the pixel distance or the range filtering radius.
[0179] Among them, the range filtering radius is positively correlated with the first mask value. The process of determining the pixel distance includes: Adding the first mask value and the pixel value of any pixel point to obtain an intermediate pixel value; Subtracting the pixel value of other pixel points in the first image from the intermediate pixel value to obtain the pixel distance. For the determination process, refer to Figure 2 Determination Process 1 in the embodiments shown. For the determination process of the range filtering radius, refer to Figure 2 Determination Process 2 in the embodiments shown, and will not be repeated here.
[0180] Optionally, the process of determining the sharpening degree includes but is not limited to: Determining the brightness intensity based on the gray value of any pixel point and a reference value. The difference between the gray value and the reference value is negatively correlated with the brightness intensity, and the brightness intensity represents the sharpening degree of any pixel point in the mask layer.
[0181] Alternatively, the degree of gray value dispersion among multiple pixel points in the third image block can be determined based on the gray value of any pixel point. The third image block is obtained by dividing the first image. The third image block includes multiple pixel points in the first image and the pixel values of each pixel point. Any pixel point whose sharpening degree is to be determined is located at the center of the third image block. The edge intensity is determined according to the degree of gray value dispersion, and the edge intensity represents the sharpening degree of any pixel point in the mask layer. For example, the degree of gray value dispersion is determined according to the gray values of each pixel point in the third image block. The gray values of each pixel point are determined based on the pixel values of each pixel point, and the degree of gray value dispersion is positively correlated with the edge intensity.
[0182] Among them, for the process of determining the brightness intensity, reference can be made to the above-mentioned Figure 2 shown determination method 1, and for the process of determining the edge intensity, reference can be made to the above-mentioned Figure 2 shown determination method 2, which will not be repeated here.
[0183] In step 1503, the pixel value of any pixel point is sharpened based on at least one of the blurring degree or sharpening degree of any pixel point to obtain the sharpened pixel value of any pixel point, and the second image corresponding to the first image is determined based on the sharpened pixel values of each pixel point.
[0184] In the case where the blurring degree is represented by the range weight and the sharpening degree is represented by the brightness intensity and the edge intensity, the process of sharpening the first image includes: bilaterally filtering any pixel point based on the range weight of any pixel point to obtain the basic pixel value of any pixel point, and the basic pixel value is located in the basic layer; obtaining the second mask value of any pixel point in the mask layer; strengthening the second mask value according to the brightness intensity and the edge intensity, and determining the sharpened pixel value of any pixel point based on the strengthened second mask value and the basic pixel value.
[0185] Among them, high-frequency enhancement filtering can be performed on any pixel point to obtain the second mask value, or the first mask value can be used as the second mask value. For the process of sharpening any pixel point to obtain the sharpened pixel value, reference can be made to Figure 2 the process in the shown embodiment where the processor 12 sharpens any pixel point to obtain the sharpened pixel value, which will not be elaborated here.
[0186] In summary, the blur degree of the basic layer can be controlled based on the edge distribution of any pixel point, and the blur degree of the pixel points in the edge area can be adaptively adjusted based on the position of the pixel points, so as to blur the sawtooth at the edge of the first image and reduce the noise of the image. In view of the fact that the gray value can reflect the possibility of any pixel point being located at the bright contrast edge, the sharpening degree of any pixel point in the mask layer is controlled based on the gray value of any pixel point, so as to adaptively adjust the sharpening degree of the pixel points located at the bright contrast edge to reduce the white edge effect of the image. The parameters used in the process of sharpening the first image in this application are not limited, and can be one or more of the intermediate pixel value, range filtering radius, edge intensity or brightness intensity, with high flexibility. Different problems that may occur in the process of sharpening the first image can be optimized based on different parameters, including but not limited to noise, sawtooth or white edge, etc., with wide generality.
[0187] An embodiment of the present application provides an electronic device, including a display panel and Figure 2 the display processing circuit as shown, and the display panel is used to display the second image processed by the image processing circuit.
[0188] Exemplarily, the electronic device can be any device with a display function and can be any terminal. Optionally, the terminal can be any electronic product that can perform human-computer interaction with the user in one or more ways such as a keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device, such as a PC (Personal Computer), mobile phone, smart phone, PDA (Personal Digital Assistant), wearable device, PPC (Pocket PC), tablet computer, smart car machine, smart TV, etc.
[0189] An embodiment of the present application also provides a display processing chip, and the chip includes Figure 2 the image processing circuit as shown.
[0190] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the first images involved in this application are all obtained under sufficient authorization.
[0191] It should be understood that the "plurality" mentioned herein refers to two or more. "And / or" describes the association relationship of associated objects and indicates that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, both A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0192] The above are only exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principle of the present application shall be included in the protection scope of the present application.
Claims
1. An image processing circuit, characterized in that, The circuit includes an input interface and a processor; The input interface is used to obtain a first image, where the first image includes a plurality of pixel points and pixel values of each pixel point among the plurality of pixel points; The processor is used to obtain the edge distribution of any pixel point in the first image, determine the blur degree of any pixel point in the base layer based on the edge distribution and the pixel value of any pixel point, and / or determine the gray value of any pixel point based on the pixel value of any pixel point, and determine the sharpening degree of any pixel point in the mask layer based on the gray value of any pixel point; The processor is further used to sharpen the pixel value of any pixel point based on at least one of the blur degree or the sharpening degree of any pixel point to obtain the sharpened pixel value of any pixel point, and determine a second image corresponding to the first image based on the sharpened pixel values of each pixel point.
2. The circuit according to claim 1, wherein The processor is used to obtain the edge distribution of any pixel point and determine a first mask value of any pixel point in the mask layer based on the edge distribution; The processor is further used to determine a value range weight of any pixel point based on the first mask value, and the value range weight represents the blur degree of any pixel point in the base layer.
3. The circuit according to claim 2, wherein The processor is used to determine the high-frequency signal of a first image block in the first image. The first image block is obtained by dividing the first image. The first image block includes a plurality of pixel points and pixel values of each pixel point in the first image. Any pixel point for which the first mask value is to be determined is located at the center of the first image block, and the high-frequency signal is correspondingly distributed in the edge region of the first image block; The processor is further used to determine the first mask value of any pixel point based on the high-frequency signal of the first image block.
4. The circuit according to claim 2, wherein The processor is used to determine the gradient matrix of a second image block in the first image. The second image block is obtained by dividing the first image. The second image block includes a plurality of pixel points and pixel values of each pixel point in the first image. Any pixel point for which the first mask value is to be determined is located at the center of the second image block, and the gradient matrix represents the edge region distributed in the second image block; The processor is further used to determine the first mask value of any pixel point based on the gradient matrix.
5. The circuit according to any one of claims 1 to 4, characterized in that, The processor is used to determine the brightness intensity based on the gray value of any pixel point and a reference value. The difference between the gray value and the reference value is negatively correlated with the brightness intensity, and the brightness intensity represents the sharpening degree of any pixel point in the mask layer.
6. The circuit according to any one of claims 1-4, characterized in that, The processor is used to determine the gray value dispersion degree among a plurality of pixel points in a third image block based on the gray value of any pixel point. The third image block is obtained by dividing the first image. The third image block includes a plurality of pixel points and pixel values of each pixel point in the first image. Any pixel point for which the sharpening degree is to be determined is located at the center of the third image block; The processor is further configured to determine the edge intensity according to the degree of gray value discreteness, where the edge intensity represents the sharpening degree of any pixel point in the mask layer.
7. The circuit according to claim 6, wherein The processor is configured to determine the degree of gray value discreteness according to the gray values of the respective pixel points in the third image block, where the gray values of the respective pixel points are determined based on the pixel values of the respective pixel points, and the degree of gray value discreteness is positively correlated with the edge intensity.
8. The circuit according to any one of claims 1-4, characterized in that, The degree of blurring is represented by a range weight, and the degree of sharpening is represented by a brightness intensity and an edge intensity. The processor is configured to bilaterally filter any pixel point based on the range weight of the any pixel point to obtain a basic pixel value of the any pixel point, and the basic pixel value is located in the basic layer. The processor is further configured to obtain a second mask value of any pixel point in the mask layer. The processor is further configured to perform enhancement processing on the second mask value according to the brightness intensity and the edge intensity, and determine a sharpened pixel value of any pixel point based on the enhanced second mask value and the basic pixel value.
9. An image processing method, characterized in that, The method includes: Obtaining a first image, where the first image includes a plurality of pixel points and pixel values of the respective pixel points in the plurality of pixel points. Obtaining the edge distribution of any pixel point in the first image, determining the degree of blurring of any pixel point in the basic layer based on the edge distribution and the pixel value of any pixel point, and / or determining the gray value of any pixel point based on the pixel value of any pixel point, and determining the sharpening degree of any pixel point in the mask layer based on the gray value of any pixel point. Sharpening the pixel value of any pixel point based on at least one of the degree of blurring or the degree of sharpening of any pixel point to obtain a sharpened pixel value of any pixel point, and determining a second image corresponding to the first image based on the sharpened pixel values of the respective pixel points.
10. The method according to claim 9, wherein The obtaining the edge distribution of any pixel point in the first image, and determining the degree of blurring of any pixel point in the basic layer based on the edge distribution and the pixel value of any pixel point includes: Obtaining the edge distribution of any pixel point, and determining a first mask value of any pixel point in the mask layer based on the edge distribution. Determining the range weight of any pixel point based on the first mask value, where the range weight represents the degree of blurring of any pixel point in the basic layer.
11. The method according to claim 9, wherein The obtaining the edge distribution of any pixel point, and determining a first mask value of any pixel point in the mask layer based on the edge distribution includes: Determining the high-frequency signal of a first image block in the first image, where the first image block is obtained by dividing the first image, the first image block includes a plurality of pixel points and pixel values of the respective pixel points in the first image, and any pixel point for which the first mask value is to be determined is located at the center of the first image block, and the high-frequency signal is correspondingly distributed in the edge region of the first image block. Determining the first mask value of any pixel point based on the high-frequency signal of the first image block.
12. The method according to claim 9, wherein Obtaining the edge distribution of any one of the pixel points, and determining a first mask value of any one of the pixel points in the mask layer based on the edge distribution, includes: Determining a gradient matrix of a second image block in the first image, where the second image block is obtained by dividing the first image, the second image block includes a plurality of pixel points in the first image and pixel values of each pixel point, and any one of the pixel points for which the first mask value is to be determined is located at the center of the second image block, and the gradient matrix represents an edge region distributed in the second image block; Determining the first mask value of any one of the pixel points based on the gradient matrix.
13. The method according to any one of claims 9-12, characterized in that, Based on the gray value of any one of the pixel points, determining the sharpening degree of any one of the pixel points in the mask layer, includes: Determining the brightness intensity based on the gray value of any one of the pixel points and a reference value, where the difference between the gray value and the reference value is negatively correlated with the brightness intensity, and the brightness intensity represents the sharpening degree of any one of the pixel points in the mask layer.
14. The method according to any one of claims 9-12, characterized in that, Based on the gray value of any one of the pixel points, determining the sharpening degree of any one of the pixel points in the mask layer, includes: Determining the gray value dispersion degree among a plurality of pixel points in a third image block based on the gray value of any one of the pixel points, where the third image block is obtained by dividing the first image, the third image block includes a plurality of pixel points in the first image and pixel values of each pixel point, and any one of the pixel points for which the sharpening degree is to be determined is located at the center of the third image block; Determining the edge intensity according to the gray value dispersion degree, where the edge intensity represents the sharpening degree of any one of the pixel points in the mask layer.
15. The method according to claim 14, characterized in that Based on the pixel value of any one of the pixel points, determining the gray value of any one of the pixel points, includes: Determining the gray value of each pixel point according to the pixel values of each pixel point in the third image block; Based on the gray value of any one of the pixel points, determining the gray value dispersion degree among a plurality of pixel points in a third image block, includes: Determining the gray value dispersion degree according to the gray values of each pixel point in the third image block, and the gray value dispersion degree is positively correlated with the edge intensity.
16. The method according to any one of claims 9-12, characterized in that The blurring degree is represented by a value range weight, and the sharpening degree is represented by the brightness intensity and the edge intensity. Sharpening the pixel value of any one of the pixel points based on at least one of the blurring degree or the sharpening degree of any one of the pixel points to obtain the sharpened pixel value of any one of the pixel points, includes: Bilaterally filtering any one of the pixel points based on the value range weight of any one of the pixel points to obtain a base pixel value of any one of the pixel points, and the base pixel value is located in the base layer; Obtaining a second mask value of any one of the pixel points in the mask layer; Performing enhancement processing on the second mask value according to the brightness intensity and the edge intensity, and determining the sharpened pixel value of any one of the pixel points based on the enhanced second mask value and the base pixel value.
17. An electronic device, characterized in that, Including the image processing circuit and the display panel according to any one of claims 1-8, where the display panel is used to display a second image processed by the image processing circuit.
18. A display processing chip, characterized in that, Including the image processing circuit according to any one of claims 1-8.