Image sharpening processing method and apparatus
By identifying regions with different attributes in an image and using specific processing parameters for sharpening, the problem of uneven results caused by different regional properties in image sharpening is solved, achieving a more optimized image processing effect.
Patent Information
- Application Number
- CN202310615752.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2043-05-29
AI Technical Summary
In existing technologies, using the same parameters for regions with different properties during image sharpening may lead to excessive noise or insufficient sharpening.
By identifying different attribute regions in the image to be processed, different processing parameters are used to sharpen each region, including dividing the region into ordinary processing regions and special processing regions, and setting corresponding gain curves and filter coefficients for each region.
The image processing effect has been optimized, avoiding excessive noise and insufficient sharpening, and improving the targeting and effectiveness of the processing.
Smart Images

Figure CN116721025B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to an image sharpening processing method and device. BACKGROUND
[0002] Image sharpening processing is an image processing method for improving the level of image details, which enhances the image detail information by extracting and adjusting the high-frequency part of the image. However, the content contained in the image to be sharpened is different, and if the same parameter is used for sharpening processing in different content areas of the image, the effect may be deviated. For example, if the same parameter is used for two regions with different properties, one of the regions may have too much noise, or the other region may not be sharpened enough. SUMMARY
[0003] Embodiments of the present application provide an image sharpening processing method and device, which identifies different attribute processing regions in the image to be processed, and performs sharpening processing on the corresponding processing regions with different processing parameters, so that the image processing is more targeted and the processing effect is optimized.
[0004] In a first aspect, embodiments of the present application provide an image sharpening processing method, comprising:
[0005] dividing the image to be processed into at least one processing region according to the pixel value of the image to be processed;
[0006] determining the gain curve of each processing region;
[0007] based on the gain curve corresponding to each processing region, respectively performing sharpening processing on the corresponding processing region.
[0008] In one embodiment, the dividing the image to be processed into at least one processing region according to the pixel value of the image to be processed comprises:
[0009] determining a first region in the image to be processed according to the pixel value of the image to be processed in at least one color space;
[0010] determining a special processing region in the first region according to the pixel difference value of the image to be processed;
[0011] determining a normal processing region in the image to be processed except the special processing region.
[0012] In one embodiment, the determining a first region in the image to be processed according to the pixel value of the image to be processed in at least one color space comprises:
[0013] For any pixel point in the image to be processed, a first pixel region centered on the current pixel point is determined;
[0014] Attribute values of the first pixel region in each color space are determined according to pixel values of all pixel points included in the first pixel region in at least one color space;
[0015] The attribute values of the first pixel region in each color space are weighted and output to obtain a comprehensive attribute value of the first pixel region;
[0016] If the comprehensive attribute value is within a preset range, the current pixel point is determined as a pixel point in the first region.
[0017] In an embodiment, a corresponding attribute value is set for each special processing region in advance;
[0018] The attribute values of the first pixel region in each color space are determined according to pixel values of all pixel points included in the first pixel region in at least one color space, including:
[0019] For each pixel point in the first pixel region under the current color space, the attribute value corresponding to the current special processing region is incremented each time a pixel value of a pixel point is detected within a range defined by any special processing region.
[0020] In an embodiment, for any pixel point in the first region, a second pixel region centered on the current pixel point is determined;
[0021] A first pixel difference value of the current pixel point is determined according to a horizontal pixel difference value and a vertical pixel difference value of each two adjacent pixel points in the second pixel region;
[0022] A second pixel difference value of the current pixel point is determined according to a maximum value and a minimum value of pixel values in the second pixel region;
[0023] Pixel points in the first region that have first and second pixel difference values meeting a preset condition are determined as pixel points of the special processing region.
[0024] In an embodiment, the sharpening processing of the respective processing regions is based on respective gain curves corresponding to each processing region, including:
[0025] Filter coefficients are determined according to respective attributes of each processing region;
[0026] Each processing region includes pixel points that are filtered according to filter coefficients corresponding to each processing region;
[0027] The filtering result of each pixel point is multiplied by the corresponding gain value based on the gain curve to obtain a filtering gain result, wherein the pixel difference value of each pixel point corresponds to one gain value in the gain curve.
[0028] In one embodiment, the method further comprises:
[0029] Overshoot suppression processing is performed on the filtering gain result based on the pixel difference value of each pixel point.
[0030] In a second aspect, an embodiment of the present application provides an image sharpening processing device, comprising:
[0031] A division module is configured to divide a to-be-processed image into a plurality of processing regions according to pixel values of the to-be-processed image.
[0032] A determination module is configured to determine a gain curve of each processing region.
[0033] A processing module is configured to perform sharpening processing on a corresponding processing region based on a gain curve corresponding to the processing region.
[0034] In a third aspect, an embodiment of the present application provides an electronic chip, comprising:
[0035] at least one processor; and
[0036] at least one memory connected to the processor in communication, wherein:
[0037] The memory stores program instructions, and the processor invokes the program instructions to execute the method provided in the first aspect.
[0038] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, comprising stored programs, wherein the programs are executed by a processor to implement the method provided in the first aspect.
[0039] In the embodiment of the present application, the to-be-processed image is first divided into at least one processing region according to pixel values of the to-be-processed image, then a gain curve of each processing region is determined, and finally sharpening processing is performed on a corresponding processing region based on a gain curve corresponding to the processing region. By identifying processing regions with different properties in the to-be-processed image and performing sharpening processing on the corresponding processing regions with different processing parameters, the image processing is more targeted, and the processing effect is optimized. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0041] Figure 1 A flow chart of an image sharpening processing method provided by an embodiment of the present application is shown in the figure.
[0042] Figure 2 A flow chart of another image sharpening processing method provided by an embodiment of the present application is shown in the figure.
[0043] Figure 3A A flow chart of another image sharpening processing method provided by an embodiment of the present application is shown in the figure.
[0044] Figure 3B A flow chart of another image sharpening processing method provided by an embodiment of the present application is shown in the figure.
[0045] Figure 4 A flow chart of another image sharpening processing method provided by an embodiment of the present application is shown in the figure.
[0046] Figure 5 A structural schematic diagram of an image sharpening processing device provided by an embodiment of the present application is shown in the figure.
[0047] Figure 6 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0048] In order to better understand the technical solutions of the present application, the following will describe the embodiments of the present application in detail with reference to the drawings.
[0049] It should be clear that the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0050] The terms used in the embodiments of the present application are only for the purpose of describing the specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0051] In view of the problem that too much noise or insufficient highlighting may occur when the same processing parameter is used to process grassland and sky in the image sharpening process, an image sharpening method is provided in the embodiment of the present application, which identifies different processing regions in the image to be processed and sharpens the corresponding processing regions with different processing parameters.
[0052] Figure 1 A flowchart of the image sharpening method provided in the embodiment of the present application is shown in FIG. 1. The method can be applied to a processing device (such as a smart phone or a camera device), which can include the following steps. Figure 1
[0053] In step 101, the image to be processed is divided into at least one processing region according to the pixel value of the image to be processed.
[0054] In the embodiment of the present application, the processing device can divide the image to be processed into a normal processing region and a special processing region according to the content of the image to be processed, wherein the special processing region can include skin color, sky, grassland, water surface and the like, and the other regions in the image to be processed except the special processing region are normal processing regions. When sharpening, if the processing device uses the same parameter to process the normal processing region and the special processing region, the effect of the special processing region after sharpening may be problematic. Therefore, the processing device needs to identify the special processing region in the image to be processed first, and select the corresponding parameter for each special processing region for processing. For example, when the processing device identifies that the image to be processed contains sky and grassland, the image to be processed can be divided into three processing regions, including a sky region, a grassland region and a remaining normal processing region, and then the corresponding parameters of the sky region, the grassland region and the normal processing region are determined respectively and sharpening is performed. In actual scenarios, one or more special processing regions may be contained in an image to be processed, or no special processing region may be contained.
[0055] In one embodiment, the specific steps of identifying the special processing region in the image to be processed by the processing device can include: first determining a first region in the image to be processed according to the pixel values of the image to be processed in at least one color space, and then determining the special processing region in the first region according to the pixel difference values of the image to be processed. It can be understood that, in order to ensure the accuracy of the identification of the special processing region, the processing device can combine the two aspects for identification. In the first aspect, the processing device can perform preliminary identification according to the pixel values of the image to be processed. For example, the pixel values of the special processing region such as the sky and the skin color are usually limited within a certain range, and the processing device can set the corresponding pixel value range for the possible special processing region in advance. When it is detected that the pixel values of some pixel points in the image to be processed are within the preset range, the corresponding pixel points can be determined as the pixel points in the first region. Further, the processing device can also convert the color space of the image to be processed, and then identify the special processing region in multiple color spaces, and then output the identification results by weighting. The processing device can further improve the identification accuracy by identifying the special processing region in multiple color spaces. In the second aspect, after the processing device identifies the first region, the pixel points in the first region can be further identified according to the pixel difference values of the image to be processed. First, the pixel difference values of each pixel point in the first region are determined, and then the pixel points in the first region whose pixel difference values meet the preset conditions are determined as the pixel points in the special processing region. Specifically, for any pixel point, the processing device can determine a pixel region centered on the current pixel point, and according to the preset processing steps, the pixel values contained in the pixel region are calculated to obtain the pixel difference value of the current pixel point. The pixel difference values of the pixel points in the special processing region are greatly different from the pixel difference values of the pixel points in the ordinary processing region, and the pixel difference values of the pixel points in different special processing regions also differ. The processing device can set the preset conditions of the pixel difference values for each special processing region in advance. When it is detected that the pixel points in the first region meet a certain preset condition, they can be determined as the pixel points in the corresponding special processing region.
[0056] In an embodiment, the specific steps of determining the first region by the processing device can include: for any pixel in the image to be processed, determining a first pixel region centered at the current pixel, determining attribute values of the first pixel region in each color space according to pixel values of all pixels in the first pixel region in at least one color space, outputting the attribute values of the first pixel region in each color space by weighting, obtaining a comprehensive attribute value of the first pixel region, and determining the current pixel as a pixel in the first region if the comprehensive attribute value is within a preset range. For example, for any pixel, the processing device can determine a first pixel region of 7*7 centered at the current pixel, which contains 49 pixels. When the processing device detects that the pixel value of any pixel in the first pixel region meets the condition of the sky region, the attribute value corresponding to the sky region is added by one, or when the processing device detects that the pixel value of the pixel meets the condition of the skin color region, the attribute value corresponding to the skin color region is added by one. The initial value of the attribute value corresponding to each special processing region can be set to 0 or other appropriate values. After the detection is completed, the processing device counts that the attribute value corresponding to the sky region is 30 and the attribute value corresponding to the skin color region is 10, that is, there are 30 pixels in the first pixel region that meet the condition of the sky region and there are 10 pixels that meet the condition of the skin color region. The processing device detects that the attribute value corresponding to the sky region is within a preset range, and determines the center pixel of the first pixel region as a pixel in the sky region. Further, the processing device can determine by multiple color spaces, for example, for the sky region, the processing device determines an attribute value in different color spaces respectively, and the processing device can obtain a comprehensive attribute value of the sky region by weighting multiple attribute values. If the comprehensive attribute value is within a preset range, the processing device can determine the center pixel of the first pixel region as a pixel in the sky region.
[0057] In an embodiment, the specific steps of determining the special processing region in the first region according to the pixel difference value of the image to be processed can include: determining, for any pixel point in the first region, a second pixel region centered on the current pixel point, determining the first pixel difference value of the current pixel point according to the horizontal pixel difference value and the vertical pixel difference value of each two adjacent pixel points in the second pixel region, determining the second pixel difference value of the current pixel point according to the maximum value and the minimum value of the pixel values in the second pixel region, and determining the pixel point in the first region whose first pixel difference value and second pixel difference value meet the preset condition as the pixel point in the special processing region. The first pixel difference value is also understood as the pixel gradient value. The processing device subtracts every two adjacent rows of the m rows and n columns of pixel points included in the second pixel region to obtain m-1 rows and n columns of vertical pixel difference values, and subtracts every two adjacent columns to obtain m rows and n-1 columns of horizontal pixel difference values. The processing device adds the absolute values of all the vertical pixel difference values and the horizontal pixel difference values to obtain the first pixel difference value. The second pixel difference value is obtained by simply subtracting the maximum value from the minimum value of the pixel values in the second pixel region. The pixel point in the first processing region also needs to meet the preset condition of the corresponding first pixel difference value and second pixel difference value to be confirmed by the processing device as the pixel point in the special processing region.
[0058] Step 102, determining the gain curve of each processing region.
[0059] The processing device can previously set a corresponding gain curve for each of the ordinary processing region and the other special processing regions. After completing the division of the processing regions, the processing device can set a corresponding identifier for each processing region, and then the processing device can obtain the corresponding gain curve of each processing region according to the identifier of the processing region.
[0060] Step 103, respectively sharpening the corresponding processing regions based on the respective gain curves corresponding to each processing region.
[0061] The horizontal coordinate of the gain curve is the pixel difference value, and the vertical coordinate is the gain value. The processing device can determine the corresponding gain value in the gain curve according to the pixel difference value of each pixel point. Due to the difference in the gain curve, the pixel points in different processing regions, even if the pixel difference value is the same, the corresponding gain value is not necessarily the same. The processing device determines the filter coefficients according to the respective attributes of each processing region, such as determining the size of the filter window. The filter coefficients suitable for different processing regions can be different, such as selecting more aggressive filter coefficients for the grass region and selecting more gentle filter coefficients for the ordinary processing region. The processing device filters the pixel points included in each processing region according to the filter coefficients of the processing region. Then, the processing device multiplies the filter result of each pixel point with the corresponding gain value of itself to obtain the final filter gain result.
[0062] In an embodiment, after the sharpening processing of the processing device on the to-be-processed region, overshoot phenomenon such as overshoot artifact may exist, and thus overshoot suppression processing needs to be performed on the obtained filter gain result. In this process, the processing device may also select appropriate control parameters for different pixel points according to the pixel difference values of the pixel points determined above, and perform overshoot suppression processing on the corresponding pixel points according to the control parameters.
[0063] In an embodiment of the present application, the processing device identifies the special processing region in the to-be-processed image and selects corresponding parameters to perform sharpening processing on different processing regions, thereby optimizing the image processing effect.
[0064] Figure 2 A flowchart of another image sharpening processing method provided in an embodiment of the present application is shown in FIG. 5. As shown in FIG. 5, the method may include the following steps. Figure 2
[0065] In step 201, a to-be-processed image is obtained.
[0066] In a specific scenario, the processing device may be a smart phone, which obtains the to-be-processed image through a camera or obtains the to-be-processed image from a memory.
[0067] In step 202, color space conversion is performed.
[0068] The processing device calculates the pixel values of the to-be-processed image in the YUV color space and the HSV color space according to the pixel values of the to-be-processed image in the RGB color space.
[0069] In step 203, a special processing region is identified.
[0070] The processing device identifies the special processing region in the to-be-processed image in the RGB color space, the YUV color space, and the HSV color space respectively, and outputs the identification results in the color spaces to obtain a final identification result.
[0071] In step 204, a pixel difference value is calculated.
[0072] The processing device calculates the pixel difference value of each pixel point according to the value of the pixel point in the YUV color space. Specifically, the processing device calculates a first pixel difference value of each pixel point according to step 204 in the YUV color space, and calculates a second pixel difference value of each pixel point according to step 204 in the HSV color space. Figure 3A Figure 3B The second pixel difference value is calculated according to the step in the method. Specifically, the processing device determines a second pixel region centered on the current pixel point for any pixel point, and then calculates the horizontal pixel difference value and the vertical pixel difference value in the second pixel region, and adds the absolute values of the horizontal pixel difference value and the vertical pixel difference value to obtain the first pixel difference value. The second pixel difference value is obtained by adding the maximum value and the minimum value of the region pixels in the second pixel region, wherein the first pixel difference value and the second pixel difference value are the values corresponding to the center pixel point. After identifying the special processing region through step 203, further confirmation is made based on the first pixel difference value and the second pixel difference value corresponding to the pixel point. For example, the sky region is relatively flat, and the first pixel difference value is usually higher than a certain threshold value. The first pixel difference value of the skin color region is usually lower than a certain threshold value. The first pixel difference value of the grass region is usually higher than a certain threshold value. The first pixel difference value and the second pixel difference value of other special processing regions have their own corresponding determination conditions. Only when the preset conditions are met, the processing device will determine that it is the corresponding special processing region.
[0073] After the processing device identifies each special processing region, the processing device can set a flag identification signal for the pixel points in the special processing region. For example, the flag of the ordinary processing region is 0, the flag of the sky region is 1, the flag of the skin color region is 2, the flag of the grass region is 3, and the flags of other special processing regions are also set accordingly.
[0074] In an embodiment, the processing device can identify the special processing region as shown in Figure 4 The processing device identifies each pixel point, first determines a first pixel region centered on the currently identified pixel point, and then traverses each pixel point in the first pixel region. When a pixel point is detected to meet the condition of a certain special processing region, the attribute value of the special processing region is incremented by one. After the traversal of the pixel points in the first pixel region is completed, it is detected whether the attribute value is within a preset range. Optionally, if the processing device identifies in multiple color spaces, the multiple attribute values are weighted and output to determine the final comprehensive attribute value. Among them, there may be more than one attribute value, and in most cases only one attribute value meets the condition of being within the preset range. Then, the processing device makes a second determination according to the pixel difference value to determine whether the current pixel point is an ordinary processing region or a pixel point of a certain special processing region. Based on the above process, the other pixel points in the image to be processed are processed to complete the identification of the special processing region in the entire image to be processed.
[0075] Step 205, determine the gain curve.
[0076] The processing device obtains the gain curve corresponding to each processing region according to the flag, and then determines the gain value corresponding to each pixel point according to the pixel difference value of the pixel point.
[0077] Step 206, filtering processing.
[0078] The processing device selects the appropriate filter coefficient according to the flag, and multiplies the filter result and the gain value to obtain the filter gain result.
[0079] Step 207, overshoot suppression processing.
[0080] The processing device determines the control parameter according to the flag and the pixel difference value, and performs overshoot suppression processing on the filter gain result.
[0081] Step 208, color space conversion.
[0082] The processing device performs the flow of calculating the pixel difference value to the overshoot suppression processing in the YUV color space, and converts to the RGB color space after the sharpening processing is completed.
[0083] Step 209, output image.
[0084] The image to be processed is output.
[0085] Other details can be referred to Figure 1 the description in the flowchart.
[0086] Figure 5 A structure diagram of an image sharpening processing device provided by an embodiment of the present application is provided. The device can be used as a specific device to realize the image sharpening processing method provided by the embodiment of the present application, as Figure 4 shown, the device can include a division module 510, a determination module 520 and a processing module 530.
[0087] The division module 510 is configured to divide the image to be processed into a plurality of processing regions according to the pixel value of the image to be processed.
[0088] The determination module 520 is configured to determine the gain curve of each processing region.
[0089] The processing module 530 is configured to perform sharpening processing on the corresponding processing region based on the gain curve corresponding to each processing region.
[0090] Figure 6 A structure diagram of an electronic device provided by an embodiment of the present application is provided. Figure 6 The electronic device shown is only an example, and should not limit the function and use range of the embodiment of the present application.
[0091] As Figure 6As shown, the electronic device is in the form of a general-purpose computing device. The components of the electronic device can include, but are not limited to, one or more processors 610, system memory 630, and a communication bus 640 that connects the various system components, including the system memory 630 and the processor 610.
[0092] The communication bus 640 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics bus (e.g., an Accelerated Graphics Port, or AGP bus) and a Local bus using any of a variety of bus architectures. By way of example, these architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0093] The electronic device typically includes a variety of computer system readable media. These media can be any available media that is accessible by the electronic device and includes both volatile and non-volatile media, removable and non-removable media.
[0094] The memory 630 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The electronic device can further include other removable / non-removable, volatile / non-volatile computer system storage media. Although Figure 6 Although not shown in the memory 630, as such, a disk drive can be provided for reading from and writing to a removable, non-removable, volatile or non-volatile, magnetic, or optical media, such as a "floppy disk" or a "hard disk" or a "compact disk" or a "digital versatile disk" (DVD) or other optical media. Each of these disk drives and their associated computer system storage media can be connected to the communication bus 640 by a disk drive interface. The memory 630 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.
[0095] The program / utility, having a set of program modules, can be stored in memory 630, for execution by the operating system, the one or more application programs, other program modules, and program data, each or some combination thereof, can include implementation of the network environment. The program modules typically carry out the functions and / or methodologies of the embodiments described herein.
[0096] The electronic device can also communicate with one or more external devices 620 such as a keyboard or a pointing device, through the communication interface 620 and with one or more devices that enable a user to interact with the electronic device. The communication can be through a communication interface 620. Further, the electronic device can communicate with one or more networks (such as a Local Area Network (LAN), a Wide Area Network (WAN), and / or the Internet through a network adapter (not shown in FIG. 6). Figure 6 The communication interface 620 can be any device or means embodied in either hardware, software, or a combination of hardware and software that is used to communicate with another device or system. For example, the communication interface 620 can be an interface to the system bus 640 from those network adapters noted above, through which the electronic device can communicate with other devices. Figure 6 It should be appreciated that the software modules described herein can not be required in all implementations, and that data used by these software modules can also be located in a RAM 632, for example, rather than in a non-volatile storage device (not shown in FIG. 6).
[0097] The processor 610 performs the various functions and processing of the embodiments described herein by executing software routines stored in the memory 630.
[0098] The embodiments of the present application also provide a computer readable storage medium, the computer readable storage medium stores computer instructions, the computer instructions make the computer execute the image sharpening processing method provided by the embodiments of the present application.
[0099] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in connection with an instruction execution system, apparatus, or device.
[0100] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0101] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0102] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0103] In addition, the terms "first", "second", etc. are used herein only to describe different instances, and do not imply or suggest relative importance or a number of the technical features indicated. Thus, the features defined with "first", "second", etc. can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise explicitly and specifically limited.
[0104] Any process or method descriptions or descriptions of the flow diagrams described herein or otherwise described herein can be understood as representing modules, segments, or portions of code that include one or more executable instructions for implementing specific logical functions or steps in the processes. The scope of preferred embodiments of the present application includes additional implementation involving other processes or methods that can be performed according to the claimed subject matter, either manually or with the aid of a computer or processor, and that are not necessarily included within the above specification. The processes or methods described herein or otherwise described herein can be understood as representing executable instructions that, when executed by a processor, software, or computing component, carry out the processes, methods, or functions described herein.
[0105] In several embodiments of the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are only illustrative, and for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0106] In addition, the functional units in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software functional units.
[0107] The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. An image sharpening processing method characterized by, The method comprises the following steps: dividing the image to be processed into at least one processing region according to pixel values of the image to be processed; determining a gain curve of each processing region; performing sharpening processing on the corresponding processing region based on the gain curve corresponding to each processing region respectively; the step of dividing the image to be processed into at least one processing region according to pixel values of the image to be processed comprises: determining a first region in the image to be processed according to pixel values of the image to be processed in at least one color space; determining a special processing region in the first region according to pixel difference values of the image to be processed; determining a common processing region in the image to be processed except the special processing region; the step of determining the special processing region in the first region according to pixel difference values of the image to be processed comprises: for any pixel point in the first region, determining a second pixel region centered on the current pixel point; determining a first pixel difference value of the current pixel point according to horizontal pixel difference values and vertical pixel difference values of each two adjacent pixel points in the second pixel region; determining a second pixel difference value of the current pixel point according to a maximum value and a minimum value of pixel values in the second pixel region; determining a pixel point in the special processing region as a pixel point in the first region whose first pixel difference value and second pixel difference value meet a preset condition; the step of performing sharpening processing on the corresponding processing region based on the gain curve corresponding to each processing region respectively comprises: determining a filter coefficient according to the attribute of each processing region; performing filter processing on pixel points included in each processing region according to the filter coefficient corresponding to each processing region; multiplying a filter result of each pixel point and a gain value corresponding to the gain curve to obtain a filter gain result, wherein the pixel difference value of each pixel point corresponds to a gain value in the gain curve.
2. The method of claim 1, wherein, the step of determining a first region in the image to be processed according to pixel values of the image to be processed in at least one color space comprises: for any pixel point in the image to be processed, determining a first pixel region centered on the current pixel point; determining attribute values of the first pixel region in each color space according to pixel values of all pixel points included in the first pixel region in at least one color space; outputting the attribute values of the first pixel region in each color space by weighting to obtain a comprehensive attribute value of the first pixel region; if the comprehensive attribute value is within a preset range, determining the current pixel point as a pixel point in the first region.
3. The method of claim 2, wherein, the step of determining attribute values of the first pixel region in each color space according to pixel values of all pixel points included in the first pixel region in at least one color space comprises: for each pixel point in the first pixel region under a current color space, adding one to the attribute value corresponding to a current special processing region each time a pixel value of a pixel point is detected within a range defined by any special processing region.
4. The method of claim 1, wherein, the method further comprises: performing overshoot suppression processing on the filter gain result based on the pixel difference value of each pixel point.
5. An image sharpening processing apparatus characterized by comprising: The division module is configured to divide the image to be processed into a plurality of processing regions according to pixel values of the image to be processed. The determination module is configured to determine a gain curve of each processing region. The processing module is configured to perform sharpening processing on each processing region according to a respective gain curve corresponding to the processing region. The division of the image to be processed into at least one processing region according to pixel values of the image to be processed comprises: determining a first region in the image to be processed according to pixel values of the image to be processed in at least one color space; determining a special processing region in the first region according to pixel difference values of the image to be processed; determining a common processing region in the image to be processed except the special processing region; The determination of the special processing region in the first region according to pixel difference values of the image to be processed comprises: for any pixel point in the first region, determining a second pixel region centered on the pixel point; determining a first pixel difference value of the pixel point according to horizontal and vertical pixel difference values of each two adjacent pixel points in the second pixel region; determining a second pixel difference value of the pixel point according to a maximum value and a minimum value of pixel values in the second pixel region; determining a pixel point in the first region as a pixel point in the special processing region if the first pixel difference value and the second pixel difference value of the pixel point meet a preset condition; The sharpening processing on each processing region according to a respective gain curve corresponding to the processing region comprises: determining a filter coefficient according to a respective attribute of each processing region; performing filter processing on pixel points included in each processing region according to a filter coefficient corresponding to the processing region; multiplying a filter result of each pixel point and a gain value corresponding to the pixel point according to the gain curve to obtain a filter gain result, wherein a pixel difference value of each pixel point corresponds to a gain value in the gain curve.
6. An electronic device, comprising: comprise: at least one processor; and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions, and the processor invokes the program instructions to execute the method according to any one of claims 1 to 4.
7. A computer readable storage medium characterized in that, The computer readable storage medium comprises a stored program, wherein the program is executed by a processor to implement the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and storage medium
CN113592776A
Image processor and image output device
JP2003281535A