Image processing method, device, equipment, storage medium and chip

CN116934875BActive Publication Date: 2026-10-30CAMBRIAN (KUNSHAN) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210336451.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2026-10-30
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

然而现有手段容易造成误检,也就是说将不是紫边的区域确定为紫边区域,导致矫正副作用,影响图像的显示

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116934875B_ABST
    Figure CN116934875B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an image processing method, device, equipment, storage medium and chip. The image processing equipment comprises a processor and a memory, the processor and the memory are connected, the memory is used for storing program code, and the processor is used for calling the program code. By using the present scheme, the false detection of the purple edge region can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image processing method, apparatus, device, storage medium, and chip. Background Technology

[0002] Purple fringing refers to the bluish-purple fringes on photographs. It often appears in areas where light and shadow meet, severely impacting image quality and visual experience. The main cause of purple fringing is lens chromatic aberration, meaning that lenses have different refractive indices for different colors of light, causing different colors of light to converge onto different focal planes. While high-end lenses optically improve purple fringing, they are expensive. Therefore, post-processing to control purple fringing is a low-cost option.

[0003] The basic idea behind controlling purple fringing in images involves two steps: detection and correction. Purple fringing has local characteristics in photographs, and current detection methods generally include highlighting, edges, and color. However, existing methods are prone to false detections, meaning that areas that are not purple-fringed are identified as purple-fringed areas, leading to side effects of correction and affecting image display. Summary of the Invention

[0004] This invention provides an image processing method, apparatus, device, storage medium, and chip that can reduce false detections in purple-edge regions.

[0005] In a first aspect, embodiments of the present invention provide an image processing method, comprising:

[0006] Each pixel in the target image is detected to obtain the pixels in the target image whose brightness changes are consistent across the R, G, and B color channels;

[0007] Obtain the chromaticity values ​​of each pixel and its neighboring pixels whose brightness changes are consistent across the three color channels R, G, and B;

[0008] The purple edge region of the target image is determined based on the chromaticity values ​​of each pixel with consistent brightness changes in the R, G, and B color channels and its neighboring pixels. The purple edge region includes target pixels with chromaticity values ​​within a preset range, and the target pixels are pixels whose chromaticity values ​​are within the preset range.

[0009] In this embodiment, the purple fringing region of the target image is determined by acquiring the chromaticity values ​​of pixels with consistent brightness changes in the R, G, and B color channels and their neighboring pixels. This method, based on the brightness changes in the R, G, and B color channels of pixels and the color of the purple fringing, reduces the probability of false positives for purple fringing detection.

[0010] Secondly, embodiments of the present invention provide an image processing apparatus, comprising:

[0011] The detection module is used to detect each pixel in the target image to obtain the pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

[0012] The acquisition module is used to acquire the chromaticity values ​​of each pixel and its neighboring pixels that have consistent brightness changes in the three color channels R, G, and B.

[0013] The determination module is used to determine the purple edge region of the target image based on the chromaticity values ​​of each pixel with consistent brightness changes in the three color channels R, G, and B and its neighboring pixels. The purple edge region includes target pixels with chromaticity values ​​within a preset range, and the target pixels are pixels whose chromaticity values ​​are within the preset range.

[0014] Thirdly, embodiments of the present invention provide an image processing device, including: a processor and a memory;

[0015] The processor is connected to a memory, wherein the memory is used to store program code, and the processor is used to call the program code to execute the image processing method described in any implementation of the first aspect.

[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the image processing method as described in any implementation of the first aspect.

[0017] Fifthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the image processing method as described in any implementation of the first aspect.

[0018] In a sixth aspect, embodiments of the present invention provide a chip system applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected via lines; the interface circuits are used to receive signals from the memory of the electronic device and send the signals to the processors, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs the image processing method as described in any implementation of the first aspect. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an image processing method provided in an embodiment of the present invention;

[0021] Figure 2 This is a flowchart illustrating another image processing method provided in an embodiment of the present invention;

[0022] Figure 3 This is a flowchart illustrating another image processing method provided in an embodiment of the present invention;

[0023] Figure 4 This is a schematic diagram of the structure of an image processing device provided in an embodiment of the present invention;

[0024] Figure 5 This is a schematic diagram of the structure of an image processing device provided in an embodiment of the present invention. Detailed Implementation

[0025] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0026] It should be understood that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0027] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this invention can be combined with other embodiments.

[0028] Please see Figure 1 , Figure 1 This is a schematic flowchart of an image processing method provided in an embodiment of the present invention. Figure 1As shown, the method includes steps 101-103, as detailed below:

[0029] 101. Detect each pixel in the target image to obtain the pixels in the target image whose brightness changes are consistent across the R, G, and B color channels;

[0030] Purple fringing typically occurs at the boundary between light and dark areas. It manifests as follows: the R and B planes of a pixel are not focused on the focal plane G plane. This blurring causes a spatial displacement in the attenuation of the three color channels, but the attenuation direction of the three color channels is consistent.

[0031] Based on this, as an optional implementation, an edge detection algorithm is used to calculate the gradients of the R, G, and B color channels for each pixel in the image. The gradient results are then used to determine whether the brightness changes of the R, G, and B color channels for each pixel are consistent, thus identifying pixels with consistent brightness changes. Specifically, the Sobel operator is used to calculate the gradients of the three color channels, and the consistency of the brightness changes of the three color channels is determined by whether the signs of the gradient results are consistent.

[0032] As an alternative implementation, the brightness changes of the three color channels are determined to be consistent by calculating the neighborhood centroids of the R, G, and B color channels of each pixel and determining whether the signs of the centroid coordinates are consistent.

[0033] 102. Obtain the chromaticity values ​​of each pixel and its neighboring pixels where the brightness changes of the three color channels R, G, and B are consistent;

[0034] Optionally, the chromaticity values ​​of each pixel and its neighboring pixels can be calculated by obtaining pixels with consistent brightness changes.

[0035] Of course, it can also be achieved by reading or receiving the chromaticity values ​​of each pixel with consistent brightness changes and its neighboring pixels, etc. This solution does not specifically limit this.

[0036] This neighborhood can be understood as a 5x5 pixel area centered on the current pixel, or a 7x7 pixel area. Of course, it can also be other sizes; this solution does not impose specific limitations on this.

[0037] The chromaticity value can be calculated in a certain color space, such as the Hue, Saturation, Value (HSV) color space.

[0038] 103. Determine the purple edge region of the target image based on the chromaticity values ​​of each pixel with consistent brightness changes in the three color channels R, G, and B, and its neighboring pixels. The purple edge region includes target pixels with chromaticity values ​​within a preset range, and the target pixels are pixels whose chromaticity values ​​are within the preset range.

[0039] The aforementioned preset range is, for example, around 300 degrees Celsius. This solution does not impose specific limitations on this.

[0040] For example, in the HSV color space, which separates color and luminance information, the purple fringing color range can be obtained by statistically analyzing the hue value of the purple fringing in the image. For the HSV color space, the purple fringing color range is, for example, around 300°. In practical judgment, it can be required that the hue of a neighboring 3x3 pixels all fall within the purple fringing color range; if this requirement is met, the pixel is considered potentially purple fringed.

[0041] Specifically, if the current pixel is within the purple edge color range, it is further confirmed whether the chromaticity of its neighboring pixels is also within the purple edge color range. If so, it indicates that the current pixel may have a purple edge.

[0042] It should be noted that this solution is only illustrated using the example that the chromaticity of the current pixel and its neighboring pixels are all within the purple edge color range. It can also meet preset ratios, etc. This solution does not make specific limitations on this.

[0043] In other words, by determining that the chromaticity of the current pixel and its neighboring pixels falls within the purple edge color range, the pixel is identified as having a purple edge. This method reduces the probability of false positives for purple edge detection.

[0044] In this embodiment, the purple fringing region of the target image is determined by calculating the chromaticity values ​​of pixels with consistent brightness changes in the R, G, and B color channels and their neighboring pixels. This method, based on the brightness changes of the R, G, and B color channels of pixels and the color of the purple fringing, reduces the probability of false positives for purple fringing detection.

[0045] Please see Figure 2 , Figure 2 This is a schematic flowchart of another image processing method provided in an embodiment of the present invention. Figure 2 As shown, the method includes steps 201-205, as detailed below:

[0046] 201. Obtain the brightness values ​​of the neighboring pixels of each pixel in the target image;

[0047] Specifically, each pixel in the image is divided into neighborhoods to obtain the neighborhood of each pixel. Then, the brightness value of each pixel in each neighborhood is calculated by weighted sum of the pixel values ​​of the R, G, and B channels. The weighting coefficients can be selected from the coefficients used in ITU-R BT.601 and BT.709 for calculating brightness.

[0048] 202. Determine the pixels whose maximum brightness value in the neighboring pixels exceeds a first preset threshold;

[0049] Based on the brightness values ​​of each neighboring pixel of each pixel obtained from the above calculation, the maximum brightness value among the neighboring pixels of each pixel is obtained; and then the pixels whose maximum brightness value among the neighboring pixels exceeds the first preset threshold are obtained.

[0050] If the maximum brightness value of a neighboring pixel exceeds a first preset threshold, the current pixel is considered to be near a bright area.

[0051] By acquiring pixels near the highlighted areas, it is helpful to identify purple fringing and reduce false positives for purple fringing.

[0052] 203. Detect pixels whose maximum brightness value in the neighborhood exceeds a first preset threshold to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

[0053] Purple fringing typically occurs at the boundary between light and dark areas. It manifests as follows: the R and B planes of a pixel are not focused on the focal plane G plane. This blurring causes a spatial displacement in the attenuation of the three color channels, but the attenuation direction of the three color channels is consistent.

[0054] Based on this, as an optional implementation, an edge detection algorithm is used to calculate the gradients of the R, G, and B color channels for each pixel whose maximum brightness value in the neighborhood exceeds a first preset threshold. The gradient results are then used to determine whether the brightness changes of the R, G, and B color channels for each pixel are consistent, thereby identifying pixels with consistent brightness changes. Specifically, the Sobel operator is used to calculate the gradients of the three color channels, and the consistency of the brightness changes of the three color channels is determined by whether the signs of the gradient results are consistent.

[0055] As another optional implementation, the brightness changes of the three color channels are determined to be consistent by calculating the neighborhood centroids of the R, G, and B color channels of pixels whose maximum brightness value exceeds a first preset threshold, and by determining whether the signs of the centroid coordinates are consistent.

[0056] 204. Obtain the chromaticity values ​​of each pixel and its neighboring pixels whose brightness changes are consistent across the three color channels R, G, and B;

[0057] By obtaining pixels with consistent brightness changes, the chromaticity values ​​of each pixel and its neighboring pixels are calculated.

[0058] This neighborhood can be understood as a 5x5 pixel area centered on the current pixel, or a 7x7 pixel area. Of course, it can also be other sizes; this solution does not impose specific limitations on this.

[0059] The chromaticity value can be calculated in a certain color space, such as the Hue, Saturation, Value (HSV) color space.

[0060] 205. Determine the purple edge region of the target image based on the chromaticity values ​​of each pixel with consistent brightness changes in the R, G, and B color channels and its neighboring pixels, wherein the purple edge region includes target pixels with chromaticity values ​​within a preset range, and the target pixels are pixels whose chromaticity values ​​are within the preset range.

[0061] If the chromaticity of the current pixel and its neighboring pixels are all within the purple edge color range, then the current pixel may have a purple edge.

[0062] In other words, by determining that the chromaticity of the current pixel and its neighboring pixels falls within the purple edge color range, the pixel is identified as having a purple edge. This method reduces the probability of false positives for purple edge detection.

[0063] The method further includes, after determining the purple-edge region of the target image, reducing the saturation of the target pixels to obtain corrected pixels.

[0064] By reducing the saturation of the target pixels, purple fringing was corrected.

[0065] Furthermore, the color plane of the corrected pixels can be low-pass filtered, while the brightness plane remains unchanged. This method reduces the abruptness caused by the large difference between the corrected purple-edge pixels and their neighboring pixels.

[0066] Of course, other methods can be used to achieve the desired color of pixels after blur correction, but this solution does not impose specific limitations on this.

[0067] In this embodiment, pixels whose maximum brightness value exceeds a first preset threshold are identified. Then, the chromaticity values ​​of pixels with consistent brightness changes in the R, G, and B color channels, along with their neighboring pixels, are calculated to determine the purple-edged region of the target image. This method, based on the brightness changes in the R, G, and B color channels of pixels near the bright area and the purple-edged color, determines the purple edge, further reducing the probability of false positives.

[0068] On the other hand, this solution corrects purple fringing by reducing the saturation of the target pixels. Simultaneously, a low-pass filter is applied to the color plane of the corrected pixels. This method reduces the abruptness caused by the large difference between the corrected purple-fringed pixels and their neighboring pixels.

[0069] Please see Figure 3 , Figure 3 This is a schematic flowchart of another image processing method provided in an embodiment of the present invention. Figure 3 As shown, the method includes steps 301-306, as detailed below:

[0070] 301. Obtain the brightness values ​​of the neighboring pixels of each pixel in the target image;

[0071] For a detailed introduction to this implementation method, please refer to [link / reference]. Figure 1 The illustrated embodiments and Figure 2 The embodiments shown are not described in detail here.

[0072] 302. Determine the pixels whose maximum brightness value in the neighboring pixels exceeds a first preset threshold;

[0073] For a detailed introduction to this implementation method, please refer to [link / reference]. Figure 2 The embodiments shown are not described in detail here.

[0074] 303. Obtain the brightness value of the pixel whose maximum brightness value in the neighboring pixels exceeds a first preset threshold, and obtain the difference between the brightness of the pixel and the maximum brightness of its neighboring pixels;

[0075] In other words, based on the brightness value of each pixel and the brightness values ​​of its neighboring pixels, the pixels near the bright area are obtained.

[0076] 304. Detect pixels whose difference between the maximum brightness of their neighboring pixels and the maximum brightness of their neighboring pixels is greater than a second preset threshold, so as to obtain pixels in the target image whose brightness changes are consistent across the three color channels R, G, and B.

[0077] Among them, high contrast boundaries are prone to purple fringing. The difference between the maximum brightness value in the neighborhood and the brightness of the current pixel is calculated. If the difference is greater than a preset threshold, it means that the current pixel is in a high contrast area and is in a dark area.

[0078] By detecting pixels in bright areas, high-contrast areas, and dark areas, we can obtain pixels with consistent brightness changes across the R, G, and B color channels.

[0079] 305. Obtain the chromaticity values ​​of each pixel and its neighboring pixels whose brightness changes are consistent across the three color channels R, G, and B;

[0080] This implementation method can be found in the description of the foregoing embodiments, and will not be repeated here.

[0081] 306. Determine the purple edge region of the target image based on the chromaticity values ​​of each pixel with consistent brightness changes in the three color channels R, G, and B, and its neighboring pixels. The purple edge region includes target pixels with chromaticity values ​​within a preset range, and the target pixels are pixels whose neighboring pixels have chromaticity values ​​within the preset range.

[0082] If the chromaticity of the current pixel and its neighboring pixels are all within the purple edge color range, then the current pixel may have a purple edge.

[0083] In other words, by determining that the chromaticity of the current pixel and its neighboring pixels falls within the purple edge color range, the pixel is identified as having a purple edge. This method reduces the probability of false positives for purple edge detection.

[0084] The method further includes, after determining the purple-edge region of the target image, reducing the saturation of the target pixels to obtain corrected pixels.

[0085] By reducing the saturation of the target pixels, purple fringing was corrected.

[0086] Furthermore, the color plane of the corrected pixels can be subjected to low-pass filtering. This method can reduce the abruptness caused by the large difference between the corrected purple-edged pixels and their neighboring pixels.

[0087] Of course, other methods can be used to achieve the desired color of pixels after blur correction, but this solution does not impose specific limitations on this.

[0088] In this embodiment, pixels whose maximum brightness value exceeds a first preset threshold and whose difference between the maximum brightness value of a neighboring pixel and the maximum brightness value of a neighboring pixel exceeds a second preset threshold are identified. Then, the chromaticity values ​​of pixels with consistent brightness changes in the R, G, and B color channels and their neighboring pixels are calculated among these pixels to determine the purple fringing region of the target image. This method, based on the brightness changes of the R, G, and B color channels of pixels near bright areas and in high-contrast areas, as well as in dark areas, and the determination of the purple fringing color, further reduces the probability of false positives for purple fringing detection.

[0089] On the other hand, this solution corrects purple fringing by reducing the saturation of the target pixels. Simultaneously, a low-pass filter is applied to the color plane of the corrected pixels. This method reduces the abruptness caused by the large difference between the corrected purple-fringed pixels and their neighboring pixels.

[0090] Based on the description of the above image processing method embodiments, this invention also discloses an image processing apparatus, with reference to... Figure 4 , Figure 4 This is a schematic diagram of an image processing device provided in an embodiment of the present invention. The image processing device includes: a detection module 401, an acquisition module 402, and a determination module 403, as detailed below:

[0091] The detection module 401 is used to detect each pixel in the target image to obtain the pixels in the target image whose brightness changes are consistent across the three color channels R, G, and B.

[0092] The acquisition module 402 is used to acquire the chromaticity values ​​of each pixel point and its neighboring pixels that have consistent brightness changes in the three color channels R, G, and B.

[0093] The determining module 403 is used to determine the purple edge region of the target image based on the chromaticity values ​​of each pixel with consistent brightness changes in the three color channels R, G, and B and its neighboring pixels. The purple edge region includes target pixels with chromaticity values ​​within a preset range, and the target pixels are pixels whose chromaticity values ​​are within the preset range.

[0094] The acquisition module 402 is further configured to:

[0095] Obtain the brightness values ​​of the neighboring pixels of each pixel in the target image;

[0096] Identify the pixels whose maximum brightness value in the neighboring pixel area exceeds a first preset threshold.

[0097] The detection module 401 is also used for:

[0098] Pixels whose maximum brightness value in the neighborhood exceeds a first preset threshold are detected to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

[0099] Furthermore, the acquisition module is also used for:

[0100] The brightness value of a pixel whose maximum brightness value in the neighborhood exceeds a first preset threshold, and the difference between the brightness of that pixel and the maximum brightness of its neighboring pixels are obtained.

[0101] The detection module 401 is also used for:

[0102] Pixels whose maximum brightness difference with their neighboring pixels is greater than a second preset threshold are detected to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

[0103] Optionally, the device further includes a calibration module for:

[0104] Reduce the saturation of the target pixel to obtain the corrected pixel.

[0105] Furthermore, it also includes a processing module for:

[0106] The color plane of the corrected pixel is subjected to low-pass filtering.

[0107] It is worth noting that the specific functional implementation of the image processing device can be found in the description of the image processing method above, and will not be repeated here. The various units or modules in the image processing device can be individually or entirely merged into one or more other units or modules, or some of the units or modules can be further divided into multiple functionally smaller units or modules. This achieves the same operation without affecting the technical effects of the embodiments of the present invention. The above-mentioned units or modules are based on logical functional division. In practical applications, the function of one unit (or module) can also be implemented by multiple units (or modules), or the function of multiple units (or modules) can be implemented by one unit (or module).

[0108] Based on the description of the above method and device embodiments, this invention also provides an image processing device.

[0109] Please see Figure 5 This is a schematic diagram of the structure of an image processing device provided in an embodiment of the present invention. Figure 5The image processing device 500 shown (which may specifically be a computer device) includes a memory 501, a processor 502, a communication interface 503, and a bus 504. The memory 501, processor 502, and communication interface 503 are interconnected via the bus 504.

[0110] The memory 501 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).

[0111] The memory 501 can store programs. When the program stored in the memory 501 is executed by the processor 502, the processor 502 and the communication interface 503 are used to execute the various steps of the image processing method of the embodiments of this application.

[0112] The processor 502 may be a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute relevant programs to achieve the functions required by the units in the image processing apparatus of this application embodiment, or to execute the image processing method of this application method embodiment.

[0113] The processor 502 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the image processing method of this application can be completed by the integrated logic circuits in the hardware of the processor 502 or by instructions in software form. The processor 502 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory 501. The processor 502 reads the information in the memory 501 and, in conjunction with its hardware, performs the functions required by the units included in the image processing apparatus of this application embodiment, or executes the image processing method of the method embodiment of this application.

[0114] The communication interface 503 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the device 500 and other devices or communication networks. For example, data can be acquired through the communication interface 503.

[0115] Bus 504 may include a pathway for transmitting information between various components of device 500 (e.g., memory 501, processor 502, communication interface 503).

[0116] It should be noted that, although Figure 5 The illustrated device 500 only shows the memory, processor, and communication interface. However, those skilled in the art should understand that in specific implementations, device 500 may also include other components necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that device 500 may also include hardware components for implementing other additional functions. Moreover, those skilled in the art should understand that device 500 may only include the components necessary for implementing the embodiments of this application, and may not necessarily include... Figure 5 All the devices shown.

[0117] This application also provides a chip system applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected via lines; the interface circuits are used to receive signals from the memory of the electronic device and send the signals to the processor, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the image processing method.

[0118] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform one or more steps of any of the above methods.

[0119] This application also provides a computer program product containing instructions. When the computer program product is run on a computer or processor, it causes the computer or processor to perform one or more steps of any of the methods described above.

[0120] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the specific descriptions of the corresponding steps in the foregoing method embodiments, and will not be repeated here.

[0121] It should be understood that in the description of this application, unless otherwise stated, " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B can represent A or B; where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. Additionally, to facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" do not necessarily imply difference. In this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being better or more advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.

[0122] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the division of units is merely a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The coupling, direct coupling, or communication connection shown or discussed between each other may be indirect coupling or communication connection through some interfaces, apparatuses, or units, and may be electrical, mechanical, or other forms.

[0123] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0124] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media can be read-only memory (ROM), random access memory (RAM), or magnetic media, such as floppy disks, hard disks, magnetic tapes, magnetic disks, or optical media, such as digital versatile discs (DVDs), or semiconductor media, such as solid-state disks (SSDs).

[0125] The foregoing can be better understood in light of the following terms:

[0126] Clause A1. An image processing method, comprising:

[0127] Each pixel in the target image is detected to obtain the pixels in the target image whose brightness changes are consistent across the R, G, and B color channels;

[0128] Obtain the chromaticity values ​​of each pixel and its neighboring pixels whose brightness changes are consistent across the three color channels R, G, and B;

[0129] The purple edge region of the target image is determined based on the chromaticity values ​​of each pixel with consistent brightness changes in the R, G, and B color channels and its neighboring pixels. The purple edge region includes target pixels with chromaticity values ​​within a preset range, and the target pixels are pixels whose chromaticity values ​​are within the preset range.

[0130] Clause A2. The method described in Clause A1 further includes:

[0131] Obtain the brightness values ​​of the neighboring pixels of each pixel in the target image;

[0132] Identify the pixels whose maximum brightness value in the neighboring pixel area exceeds a first preset threshold.

[0133] The step of detecting each pixel in the target image to obtain pixels in the target image with consistent brightness changes across the R, G, and B color channels includes:

[0134] Pixels whose maximum brightness value in the neighborhood exceeds a first preset threshold are detected to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

[0135] Clause A3. The method described pursuant to Clause A2 further includes:

[0136] The brightness value of a pixel whose maximum brightness value in the neighborhood exceeds a first preset threshold, and the difference between the brightness of that pixel and the maximum brightness of its neighboring pixels are obtained.

[0137] The step of detecting pixels whose maximum brightness value in the neighboring pixels exceeds a first preset threshold, in order to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels, includes:

[0138] Pixels whose maximum brightness difference with their neighboring pixels is greater than a second preset threshold are detected to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

[0139] Clause A4. The method described under any one of Clauses A1 to A3 further includes:

[0140] Reduce the saturation of the target pixel to obtain the corrected pixel.

[0141] Clause A5. The method described pursuant to Clause A4 further includes:

[0142] The color plane of the corrected pixel is subjected to low-pass filtering.

[0143] Clause A6. An image processing apparatus comprising:

[0144] The detection module is used to detect each pixel in the target image to obtain the pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

[0145] The acquisition module is used to acquire the chromaticity values ​​of each pixel and its neighboring pixels that have consistent brightness changes in the three color channels R, G, and B.

[0146] The determination module is used to determine the purple edge region of the target image based on the chromaticity values ​​of each pixel with consistent brightness changes in the three color channels R, G, and B and its neighboring pixels. The purple edge region includes target pixels with chromaticity values ​​within a preset range, and the target pixels are pixels whose chromaticity values ​​are within the preset range.

[0147] Clause A7. The apparatus according to Clause A6, wherein the acquisition module is further configured to:

[0148] Obtain the brightness values ​​of the neighboring pixels of each pixel in the target image;

[0149] Identify the pixels whose maximum brightness value in the neighboring pixel area exceeds a first preset threshold.

[0150] The detection module is also used for:

[0151] Pixels whose maximum brightness value in the neighborhood exceeds a first preset threshold are detected to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

[0152] Clause A8. The apparatus according to Clause A7, wherein the acquisition module is further configured to:

[0153] The brightness value of a pixel whose maximum brightness value in the neighborhood exceeds a first preset threshold, and the difference between the brightness of that pixel and the maximum brightness of its neighboring pixels are obtained.

[0154] The detection module is also used for:

[0155] Pixels whose maximum brightness difference with their neighboring pixels is greater than a second preset threshold are detected to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

[0156] Clause A9. The apparatus according to any one of Clauses A6 to A8 further includes a calibration module for:

[0157] Reduce the saturation of the target pixel to obtain the corrected pixel.

[0158] Clause A10. The apparatus according to Clause A9 further includes a processing module for:

[0159] The color plane of the corrected pixel is subjected to low-pass filtering.

[0160] Clause A11. An image processing apparatus, comprising: a processor and a memory;

[0161] The processor is connected to a memory, wherein the memory is used to store program code, and the processor is used to call the program code to execute the image processing method as described in any one of clauses A1-A5.

[0162] Clause A12. A computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, perform an image processing method as described in any one of Clauses A1-A5.

[0163] Clause A13. A computer program product comprising a computer program that, when executed by a processor, implements the image processing method as described in any one of Clauses A1-A5.

[0164] Clause A14. A chip system applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected via lines; the interface circuits are configured to receive signals from a memory of the electronic device and send the signals to the processors, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs an image processing method as described in any one of Clauses A1 to A5.

[0165] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.

Claims

1. An image processing method, characterized in that, include: Obtain the brightness values ​​of the neighboring pixels of each pixel in the target image; Identify the pixels whose maximum brightness value in the neighboring pixel area exceeds a first preset threshold. Pixels whose maximum brightness value in the neighborhood exceeds a first preset threshold are detected to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels. Obtain the chromaticity values ​​of each pixel and its neighboring pixels whose brightness changes are consistent across the three color channels R, G, and B; Based on the chromaticity values ​​of each pixel and its neighboring pixels with consistent brightness changes in the R, G, and B color channels, the purple edge region of the target image is determined. The purple edge region includes target pixels, which include pixels whose own and their neighboring pixels' chromaticity values ​​are all within a preset range, or pixels whose own and their neighboring pixels' chromaticity values ​​satisfy a preset proportion within a preset range.

2. The method according to claim 1, characterized in that, The method further includes: The brightness value of a pixel whose maximum brightness value in the neighborhood exceeds a first preset threshold, and the difference between the brightness of that pixel and the maximum brightness of its neighboring pixels are obtained. The step of detecting pixels whose maximum brightness value in the neighboring pixels exceeds a first preset threshold, in order to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels, includes: Pixels whose maximum brightness difference with their neighboring pixels is greater than a second preset threshold are detected to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

3. The method according to claim 1 or 2, characterized in that, The method further includes: Reduce the saturation of the target pixel to obtain the corrected pixel.

4. The method according to claim 3, characterized in that, The method further includes: The color plane of the corrected pixel is subjected to low-pass filtering.

5. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire the brightness values ​​of the neighboring pixels of each pixel in the target image, and to determine the pixels whose maximum brightness value of the neighboring pixels exceeds a first preset threshold. The detection module is used to detect pixels whose maximum brightness value in the neighborhood exceeds a first preset threshold, so as to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels. The acquisition module is also used to acquire the chromaticity values ​​of each pixel point and its neighboring pixels that have consistent brightness changes in the three color channels R, G, and B. The determining module is used to determine the purple edge region of the target image based on the chromaticity values ​​of each pixel point and its neighboring pixels with consistent brightness changes in the three color channels R, G, and B. The purple edge region includes target pixels, which include pixels whose own and their neighboring pixels have chromaticity values ​​within a preset range, or pixels whose own and their neighboring pixels have chromaticity values ​​within a preset range that satisfy a preset proportion.

6. The apparatus according to claim 5, characterized in that, The acquisition module is also used for: The brightness value of a pixel whose maximum brightness value in the neighborhood exceeds a first preset threshold, and the difference between the brightness of that pixel and the maximum brightness of its neighboring pixels are obtained. The detection module is also used for: Pixels whose maximum brightness difference with their neighboring pixels is greater than a second preset threshold are detected to obtain pixels in the target image whose brightness changes are consistent across the R, G, and B color channels.

7. The apparatus according to claim 5 or 6, characterized in that, It also includes a calibration module for: Reduce the saturation of the target pixel to obtain the corrected pixel.

8. The apparatus according to claim 7, characterized in that, It also includes a processing module for: The color plane of the corrected pixel is subjected to low-pass filtering.

9. An image processing device, characterized in that, include: Processor and memory; The processor is connected to a memory, wherein the memory is used to store program code, and the processor is used to call the program code to execute the image processing method as described in any one of claims 1-4.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions, which, when executed by a processor, perform the image processing method as described in any one of claims 1-4.

11. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the image processing method as described in any one of claims 1-4.

12. A chip system, characterized in that, The chip system is applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected via lines; the interface circuits are used to receive signals from the memory of the electronic device and send the signals to the processors, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs the image processing method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and device for determining color edge pixel points in image and computer equipment

    CN113393540A

  • Image processing apparatus and method, and image processing program

    JP2011205399A