Image processing method and device, equipment and storage medium

By obtaining RAW image data in a digital camera, accurately identifying and processing the purple edge area, the purple edge problem during shooting of digital cameras is solved, and the image quality and processing effect are improved.

CN119031252APending Publication Date: 2024-11-26BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310612862.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In the prior art, due to the limitations of hardware structure and optical design during shooting, purple, light blue or magenta pseudo-color bright edges appear at the edges of objects or at the junction of light and darkness, which affects the image quality and now There is a purple edge correction method that is difficult to completely remove after color processing, which can easily cause image objects to lose color.

Method used

By obtaining image data in RAW format, determine the purple edge area, and then convert it to other image formats in RAW format to perform purple edge correction. Use preset edge detection operators and pixel thresholds to determine the edge area, and combine the specified color range to accurately Identify the purple edge area and set weight control in color processing to avoid color enhancement of non-purple edge areas.

Benefits of technology

Effectively remove purple edges, improve image quality, avoid color loss in objects in the image, reduce the difficulty of removing purple edges, and improve the accuracy and effect of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031252A_ABST
    Figure CN119031252A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing method and device, equipment and a storage medium. The method comprises the following steps: acquiring first image data; determining a purple boundary area in the first image data; performing conversion based on the first image data to obtain second image data in a first image format; and performing purple edge correction on the second image data according to the purple edge region to obtain third image data. According to the method and the device, the color of the purple edge region can be prevented from being enhanced, so that the difficulty of subsequently correcting the purple edge region can be reduced, the purple edge removing intensity does not need to be increased, the problem of color losing of partial objects in the image can be effectively avoided, and the effect of improving the image quality is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, equipment and storage medium. Background Art

[0002] At present, due to the limitations of hardware structure, optical design and other conditions, when shooting digital cameras, when the brightness contrast of the scene being photographed is large, it is easy to cause the edge of the object or the junction of light and dark to appear purple, light blue or magenta and other false color bright edges, collectively known as purple fringing. The appearance of purple fringing will have a negative impact on the image quality, so purple fringing correction (removal) is an important part of image processing. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the embodiments of the present disclosure provide an image processing method, apparatus, device and storage medium to solve the defects in the related art.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, the method comprising:

[0005] Acquire first image data, where the first image data is image data in a RAW format;

[0006] determining a purple-fringed region in the first image data;

[0007] Converting the first image data to obtain second image data in a first image format;

[0008] Purple fringing correction is performed on the second image data according to the purple fringing area to obtain third image data.

[0009] In some embodiments, the method further comprises:

[0010] Performing a first preprocessing on the first image data to obtain first preprocessed image data;

[0011] The first pre-processed image data is used as the first image data, and the operation of determining the purple-fringed area in the first image data is performed.

[0012] In some embodiments, determining the purple-fringed region in the first image data includes:

[0013] Determine a first area in the first image data, where the first area is an area in the first image data having a brightness greater than or equal to a set brightness threshold and located at an edge of the photographed object;

[0014] Determine a designated color region in the first image data, wherein the designated color region is a region of a designated color in the first image data;

[0015] A purple-fringe area in the first image data is determined based on the first area and the designated color area.

[0016] In some embodiments, determining the first region in the first image data comprises:

[0017] Determine a first response map of the first image data based on a preset edge detection operator, where the first response map is used to characterize an area where an edge of a photographed object in the first image data is located;

[0018] Determine a second response map of the first image data based on a preset pixel threshold, wherein the second response map is used to characterize an area in the first image data with a brightness greater than or equal to a set brightness threshold;

[0019] determining a third response map based on the first response map and the second response map, wherein the third response map is used to characterize the first region in the first image data;

[0020] A first region in the first image data is determined based on the third response map.

[0021] In some embodiments, determining the designated color area in the first image data includes:

[0022] Convert the first image data from the RGB space to a preset color space to obtain a converted image;

[0023] Determining a color matching region in the converted image based on a specified color range predefined in the preset color space;

[0024] An area in the first image data corresponding to the color matching area is determined as the designated color area.

[0025] In some embodiments, the method further comprises:

[0026] Performing second preprocessing on the first image data to obtain second preprocessed image data;

[0027] The operation of determining the first area in the first image data is performed by using the second pre-processed image data as the first image data.

[0028] In some embodiments, the method further comprises:

[0029] Based on a preset color processing module, color processing is performed on the non-purple-edge region in the second image data to obtain fourth image data;

[0030] The fourth image data is used as the second image data, and the operation of performing purple-fringe correction on the second image data according to the purple-fringe area is performed.

[0031] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, the apparatus comprising:

[0032] An image data acquisition module, used to acquire first image data, where the first image data is image data in a RAW format;

[0033] A purple-fringe region determining module, configured to determine a purple-fringe region in the first image data;

[0034] An image data conversion module, configured to obtain second image data in a first image format based on the first image data;

[0035] The image data correction module is used to perform purple fringing correction on the second image data according to the purple fringing area to obtain third image data.

[0036] In some embodiments, the apparatus further comprises:

[0037] A first processing module, used for performing a first preprocessing on the first image data to obtain first preprocessed image data;

[0038] The purple-fringe region determining module is further configured to use the first pre-processed image data as the first image data and perform the operation of determining the purple-fringe region in the first image data.

[0039] In some embodiments, the purple-fringe region determination module includes:

[0040] A first determining unit, configured to determine a first area in the first image data, where the first area is an area in the first image data having a brightness greater than or equal to a set brightness threshold and located at an edge of the photographed object;

[0041] A second determining unit, configured to determine a designated color region in the first image data, wherein the designated color region is a region of a designated color in the first image data;

[0042] The area determination unit is used to determine the purple-fringe area in the first image data based on the first area and the designated color area.

[0043] In some embodiments, the first determining unit is further configured to:

[0044] Determine a first response map of the first image data based on a preset edge detection operator, where the first response map is used to characterize an area where an edge of a photographed object in the first image data is located;

[0045] Determine a second response map of the first image data based on a preset pixel threshold, wherein the second response map is used to characterize an area in the first image data with a brightness greater than or equal to a set brightness threshold;

[0046] determining a third response map based on the first response map and the second response map, wherein the third response map is used to characterize the first region in the first image data;

[0047] A first region in the first image data is determined based on the third response map.

[0048] In some embodiments, the second determining unit is further configured to:

[0049] Convert the first image data from the RGB space to a preset color space to obtain a converted image;

[0050] Determining a color matching region in the converted image based on a specified color range predefined in the preset color space;

[0051] An area in the first image data corresponding to the color matching area is determined as the designated color area.

[0052] In some embodiments, the purple-fringe area determination module further includes:

[0053] A second processing unit, configured to perform a second preprocessing on the first image data to obtain second preprocessed image data;

[0054] The first determining unit is further configured to use the second pre-processed image data as the first image data and perform the operation of determining the first area in the first image data.

[0055] In some embodiments, the image data conversion module is further used to perform color processing on the non-purple-fringed area in the second image data to obtain fourth image data;

[0056] The image data correction module is further configured to use the fourth image data as the second image data and perform the operation of performing purple fringing correction on the second image data according to the purple fringing area.

[0057] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, the device comprising:

[0058] a processor and a memory for storing a computer program;

[0059] Wherein, the processor is configured to implement, when executing the computer program:

[0060] Acquire first image data, where the first image data is image data in a RAW format;

[0061] determining a purple-fringed region in the first image data;

[0062] Converting the first image data to obtain second image data in a first image format;

[0063] Purple fringing correction is performed on the second image data according to the purple fringing area to obtain third image data.

[0064] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the following is implemented:

[0065] Acquire first image data, where the first image data is image data in a RAW format;

[0066] determining a purple-fringed region in the first image data;

[0067] Converting the first image data to obtain second image data in a first image format;

[0068] Purple fringing correction is performed on the second image data according to the purple fringing area to obtain third image data.

[0069] The technical solution provided by the disclosed embodiments may include the following beneficial effects:

[0070] The present invention obtains first image data, which is image data in a RAW format, determines a purple-fringed area in the first image data, then converts the first image data into second image data in a first image format, and then performs purple-fringing correction on the second image data according to the purple-fringed area to obtain third image data. This can avoid subsequent enhancement of the color of the purple-fringed area and avoid the problem of color loss of some objects in the image, thereby achieving the effect of improving image quality.

[0071] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0073] Figure 1A is a flowchart of an image processing method according to an exemplary embodiment of the present disclosure;

[0074] Figure 1Bis a schematic diagram showing first image data according to an exemplary embodiment of the present disclosure;

[0075] Figure 1C is a schematic diagram showing third image data according to an exemplary embodiment of the present disclosure;

[0076] Figure 2 is a flowchart showing how to determine the purple-fringe area in the first image data according to an exemplary embodiment of the present disclosure;

[0077] Figure 3 is a flowchart showing how to determine a first area in the first image data according to an exemplary embodiment of the present disclosure;

[0078] Figure 4A is a flowchart showing how to determine a designated color area in the first image data according to an exemplary embodiment of the present disclosure;

[0079] Figure 4B is a schematic diagram showing a specified color range according to an exemplary embodiment of the present disclosure;

[0080] Figure 5 is a block diagram of an image processing device according to an exemplary embodiment of the present disclosure;

[0081] Figure 6 is a block diagram of another image processing device according to an exemplary embodiment of the present disclosure;

[0082] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0083] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0084] At present, due to the limitations of hardware structure, optical design and other conditions, when shooting digital cameras, when the brightness contrast of the scene being photographed is large, it is easy to cause the edge of the object or the junction of light and dark to appear purple, light blue or magenta and other false color bright edges, collectively known as purple fringing. The appearance of purple fringing will have a negative impact on the image quality, so purple fringing correction (removal) is an important part of image processing.

[0085] In the related art, purple fringing correction is usually performed after image data conversion (e.g., image data conversion including color processing, etc.). For example, the input original image needs to be processed by color processing modules such as the white balance correction module AWB, the color restoration module CCM, and the color processing module Color, and then corrected by the image data correction module, which causes the purple fringing on the first image data to be gradually strengthened, and thus makes it difficult to remove the purple fringing in the image. If the intensity of the purple fringing removal is increased, it is easy to cause some objects in the image to lose color. Therefore, a more effective solution for purple fringing correction is urgently needed.

[0086] In view of this, the present disclosure provides the following image processing methods, devices, equipment and storage media to solve the above-mentioned defects in the related art.

[0087] Figure 1A is a flowchart of an image processing method according to an exemplary embodiment; the method of this embodiment can be executed by an image processing device, which can be configured in an electronic device, such as a server, a workstation, a personal computer, a mobile terminal (such as a mobile phone, a camera, a video camera, a tablet computer, etc.), a wearable device (such as glasses, a watch, etc.), etc. Figure 1A As shown, the method includes the following steps S101-S104:

[0088] In step S101 , first image data is acquired, where the first image data is image data in a RAW format.

[0089] In this embodiment, when the electronic device executes the image processing solution, first image data can be acquired, and the first image data is image data in a RAW format.

[0090] In some embodiments, when the electronic device is in a scene such as taking a photo, recording a video, or previewing, the first image data of the current scene, such as a RAW image, can be acquired.

[0091] For example, the first image data can be obtained based on an electronic device by triggering a shooting function button on the electronic device (such as a physical button or a virtual button in a shooting application, etc.), or by triggering a shooting instruction for the electronic device based on a preset instruction (such as a voice instruction or a gesture instruction), and then the electronic device can respond to the instruction and obtain the first image data through an image acquisition device (such as a camera, etc.) of the electronic device.

[0092] In step S102, a purple-fringe area in the first image data is determined.

[0093] In this embodiment, after acquiring the first image data, the electronic device may determine the purple-fringe area in the first image data.

[0094] For example, after the first image data is obtained, the purple-fringe area in the first image data may be determined based on a preset method.

[0095] The above method for determining the purple-edge region in the first image data can refer to the following Figure 2 The embodiment shown will not be described in detail here. It is worth noting that this embodiment can also be selected from other methods in related technologies based on actual business needs to cooperate or replace Figure 2 The purple-fringe area determination method of the illustrated embodiment is not limited in this embodiment.

[0096] In some embodiments, before executing the above step S102, the first image data may be subjected to a first preprocessing to obtain first preprocessed image data, and then the first preprocessed image data is used as the first image data to perform the operation of determining the purple-fringed region in the first image data as described in the above step S102. Exemplarily, the first preprocessing method may include: at least one of bad pixel correction, black level correction, and lens shading correction.

[0097] It can be understood that after the first image data in the RAW format is processed by at least one of bad pixel correction, black level correction, and lens shading correction, it is still an image in the RAW format.

[0098] In step S103, second image data in a first image format is obtained based on the conversion of the first image data.

[0099] In this embodiment, after the purple-fringed area in the first image data is determined, the second image data in the first image format can be converted based on the first image data. The first image format can be set based on the needs of the actual application scenario, such as being set to a YUV format, etc., which is not limited in this embodiment.

[0100] In step S104, purple fringing correction is performed on the second image data according to the purple fringing area to obtain third image data.

[0101] In this embodiment, after the second image data in the first image format is obtained based on the conversion of the first image data, purple fringing correction may be performed on the second image data according to the purple fringing area to obtain third image data.

[0102] In some embodiments, the purple-fringed region in the second image data may be removed based on a preset purple-fringing removal module. Exemplarily, the purple-fringing removal module may be used to reduce the saturation of the purple-fringed region in the second image data to achieve correction of the purple-fringed region.

[0103] Furthermore, when the purple fringing removal module corrects the purple fringing area, weights corresponding to different pixel values ​​in the purple fringing area can also be set to control the purple fringing removal strength of the purple fringing removal module based on the weights. It can be understood that the greater the weight, the greater the strength of the purple fringing removal; the smaller the weight, the smaller the strength of the purple fringing removal.

[0104] In other embodiments, after the second image data in the first image format is converted based on the first image data as described in the above step S103, color processing can be performed on the non-purple-fringed area in the second image data based on a preset color processing module (for example, enhancing the color of the non-purple-fringed area, etc.) to obtain fourth image data; then, the electronic device can use the fourth image data as the second image data to perform the operation of performing purple-fringing correction on the second image data according to the purple-fringed area.

[0105] Among them, the above-mentioned preset color processing module can be selected from relevant technologies according to actual business needs, such as selecting at least one of the white balance correction module AWB, the color restoration module CCM, the color processing module Color, etc., which is not limited in this embodiment.

[0106] For example, assuming that the selected color processing modules are AWB, CCM and Color, the original RAW image can be processed by AWB to obtain an image (the image is still in RAW format) and then CCM can convert the RAW format image into an RGB image for processing, and pass the processed image to Color, and then Color can convert the RGB image into a YUV image for processing. It is worth noting that when processing the corresponding images, the above three color processing modules can use a larger color enhancement strength to enhance the color of the non-purple-edge area in the image, and use a smaller color enhancement strength to enhance the color of the purple-edge area; or, only the non-purple-edge area in the image can be color enhanced, and the purple-edge area can not be color enhanced.

[0107] In some embodiments, when any of the above color processing modules processes the corresponding image, weights corresponding to the non-purple-fringed area and the purple-fringed area can be set to control the color enhancement strength of the color processing module based on the weights. It can be understood that the greater the weight, the greater the color enhancement strength; the smaller the weight, the smaller the color enhancement strength.

[0108] Specifically, Figure 1B is a schematic diagram showing first image data according to an exemplary embodiment of the present disclosure; Figure 1C FIG. 1 is a schematic diagram showing third image data according to an exemplary embodiment of the present disclosure. Figure 1B and Figure 1CIt can be seen that after being processed by the image processing solution of this embodiment, Figure 1B The purple-edge regions in the image (e.g., the edges of clusters a01, a02, and a03) are effectively removed. Figure 1C The flower clusters in areas a01, a02, and a03 in the figure appear sparse and clearer. Figure 1C The non-purple-fringed areas in the image (such as the areas where objects such as tree trunks and leaves are located) are not affected, thereby improving the image quality.

[0109] On the basis of the above embodiment, after the third image data is obtained, the third image data may be further processed to output a captured image for viewing and / or storage by a user.

[0110] That is to say, the image data involved in the above steps S101-S104 are data in the image processing stage, and the obtained third image data can be processed by other image data processing methods in related technologies to generate captured images. This embodiment does not limit other image data processing methods.

[0111] As can be seen from the above description, the method of this embodiment obtains first image data, which is image data in a RAW format, and determines a purple-fringed area in the first image data, and then converts the first image data into second image data in the first image format, and then performs purple-fringing correction on the second image data according to the purple-fringed area to obtain third image data. Since the purple-fringed area is determined in the first image data in the RAW format and then the first image data is converted into the second image data, the process of determining the purple-fringed area can be avoided from being affected by the subsequent color processing process, and the subsequent color enhancement of the purple-fringed area can be avoided, thereby reducing the difficulty of subsequent correction of the purple-fringed area, and there is no need to increase the intensity of de-purple fringing, so the problem of discoloration of some objects in the image can be effectively avoided, thereby achieving the effect of improving image quality.

[0112] Figure 2 It is a flowchart showing how to determine the purple-edge region in the first image data according to an exemplary embodiment of the present disclosure; based on the above-mentioned embodiment, this embodiment takes how to determine the purple-edge region in the first image data as an example for exemplary description.

[0113] like Figure 2 As shown, the determination of the purple-fringed area in the first image data in the above step S102 may include the following steps S201-S203:

[0114] In step S201, a first area in the first image data is determined.

[0115] In this embodiment, after first image data is acquired, where the first image data is image data in a RAW format, a first area in the first image data may be determined.

[0116] The first area may be an area in the first image data whose brightness is greater than or equal to a set brightness threshold and located at the edge of the photographed object.

[0117] The above-mentioned method of determining the first area in the first image data can refer to the explanation and description in the relevant technology, and this embodiment does not limit this.

[0118] In some embodiments, before executing step S201, the first image data may be subjected to a second preprocessing to obtain second preprocessed image data, and then the second preprocessed image data may be used as the first image data to execute the operation of step S201. Exemplarily, the second preprocessing method may include gamma correction and / or noise reduction processing.

[0119] In some other embodiments, the above method of determining the first area in the first image data can also refer to the following Figure 3 The illustrated embodiment will not be described in detail here.

[0120] In step S202, a designated color area in the first image data is determined.

[0121] In this embodiment, after first image data is acquired, where the first image data is image data in a RAW format, a designated color area in the first image data may be determined.

[0122] The designated color region may be a region of a designated color (eg, purple, light blue, magenta, etc.) in the first image data.

[0123] In some embodiments, the above method of determining the designated color area in the first image data can refer to the explanations and descriptions in the relevant technology, and this embodiment does not limit this.

[0124] In some other embodiments, the above method of determining the specified color area in the first image data can also refer to the following Figure 4A The illustrated embodiment will not be described in detail here.

[0125] It is worth noting that the order of steps S201 and S202 is only for illustrative purposes. In actual applications, step S202 may be executed first and then step S201, or steps S201 and S202 may be executed simultaneously based on scenario requirements. This embodiment does not limit this.

[0126] In step S203, a purple-fringe area in the first image data is determined based on the first area and the designated color area.

[0127] In this embodiment, after determining the first region and the designated color region in the first image data, the purple-fringed region in the first image data can be determined based on the first region and the designated color region. For example, the intersection of the first region and the designated color region can be determined, and the intersection can be determined as the purple-fringed region in the first image data. On this basis, the region other than the purple-fringed region in the first image data can be determined as the non-purple-fringed region.

[0128] As can be seen from the above description, this embodiment determines the first area in the first image data, determines the designated color area in the first image data, and then determines the purple-fringed area in the first image data based on the first area and the designated color area. This can achieve accurate determination of the purple-fringed area in the first image data, and then can achieve subsequent conversion based on the first image data to obtain second image data in a first image format, and performs purple-fringing correction on the second image data according to the purple-fringed area to obtain third image data, which can avoid color enhancement of the purple-fringed area, and thus reduce the difficulty of subsequent correction of the purple-fringed area, and there is no need to increase the intensity of de-purple-fringing, so that the problem of discoloration of some objects in the image can be effectively avoided, thereby achieving the effect of improving image quality.

[0129] Figure 3 It is a flowchart showing how to determine the first area in the first image data according to an exemplary embodiment of the present disclosure; this embodiment is based on the above embodiment and takes how to determine the first area in the first image data as an example for exemplary description.

[0130] like Figure 3 As shown, the determination of the first area in the first image data in the above step S201 may include the following steps S301-S303:

[0131] In step S301, a first response graph of the first image data is determined based on a preset edge detection operator.

[0132] In this embodiment, when determining the first area in the first image data, a first response map of the first image data can be determined based on a preset edge detection operator. The first response map is used to characterize the area where the edge of the photographed object in the first image data is located. Therefore, the above-mentioned first response map can also be understood as the edge response map of the above-mentioned first image data. Exemplarily, the response value in the first response map can be used to characterize the possibility that the pixel point in the first image data is located in the area where the edge of the photographed object is located. That is, the larger the response value corresponding to a certain pixel point, the higher the possibility that the point is located in the area where the edge of the photographed object is located. On this basis, different response values ​​can be displayed in different colors in the first response map (for example, the larger the response value, the brighter the displayed color), so that the edge area of ​​the photographed object can be highlighted in the first response map.

[0133] In some embodiments, an edge detector may be used to detect the edge response of the first image data. The edge detector operator may be divided into vertical and horizontal directions, and may be a Laplace operator, a Gaussian function operator, etc., which is not limited in this embodiment. The edge detector may also flexibly set different length and width ranges through parameters D_W and D_H to adapt to different image acquisition scenarios and ensure the flexibility of edge detection.

[0134] In step S302, a second response map of the first image data is determined based on a preset pixel threshold.

[0135] In this embodiment, the second response map of the first image data can be determined based on a preset pixel threshold. The second response map is used to characterize the area in the first image data where the brightness is greater than or equal to the set brightness threshold (e.g., it can be called a "highlight area"). Therefore, the above-mentioned second response map can also be understood as a highlight response map of the above-mentioned first image data. Exemplarily, the response value in the second response map can be used to characterize the possibility that the pixel point in the first image data is located in the highlight area. That is, the larger the response value corresponding to a certain pixel point, the higher the possibility that the point is located in the highlight area. On this basis, different response values ​​can be displayed in different colors in the second response map (e.g., the larger the response value, the brighter the displayed color), so that the edge area of ​​the photographed object can be highlighted in the second response map.

[0136] For example, pixel thresholds R_min, G_min and B_min may be preset, and the region where R>R_min, G>G_min and B>B_min in the RGB image data is located is identified as a highlight region to obtain the second response map of the first image data.

[0137] In step S303, a third response graph is determined based on the first response graph and the second response graph.

[0138] In this embodiment, after determining the first response map and the second response map of the first image data, the third response map can be determined based on the first response map and the second response map. Among them, the third response map is used to characterize the first area in the first image data, that is, the area in the first image data where the brightness is greater than or equal to the set brightness threshold and is located at the edge of the photographed object. Therefore, the third response map can also be understood as a highlight edge response map of the first image data. Exemplarily, the response value in the third response map can be used to characterize the possibility that the pixel point in the first image data is located in the first area. That is, the larger the response value corresponding to a pixel point, the higher the possibility that the point is located in the first area. On this basis, different response values ​​can be displayed in different colors in the third response map (for example, the larger the response value, the brighter the displayed color), so that the first area can be highlighted in the third response map.

[0139] For example, assuming that the first response map of the first image data is I_edge and the second response map is I_HL, the third response map I_edgemap can be obtained by multiplying the two, that is:

[0140] I_edgemap=I_edge* I_HL; (3-1)

[0141] In step S304, a first region in the first image data is determined based on the third response map.

[0142] In this embodiment, after the third response map is determined based on the first response map and the second response map, the first region in the first image data may be determined based on the third response map.

[0143] For example, the first response map may be matched with the first image data to determine a region in the first image data corresponding to a highlighted region of the first response map as the first region.

[0144] From the above description, it can be seen that this embodiment determines the first response map of the first image data based on a preset edge detection operator, determines the second response map of the first image data based on a preset pixel threshold, and then determines the third response map based on the first response map and the second response map, so as to accurately determine the first area in the first image data, and then subsequently determine the purple-fringe area in the first image data based on the first area and the specified color area, so as to accurately remove the purple-fringe area.

[0145] Figure 4AIt is a flowchart showing how to determine a specified color area in the first image data according to an exemplary embodiment of the present disclosure; based on the above embodiment, this embodiment uses how to determine a specified color area in the first image data as an example to exemplify.

[0146] like Figure 4A As shown, the determination of the designated color area in the first image data in the above step S202 may include the following steps S401-S403:

[0147] In step S401, the first image data is converted from the RGB space to a preset color space to obtain a converted image.

[0148] In this embodiment, when determining the designated color region in the first image data, the first image data may be first converted from an RGB space to a preset color space to obtain a converted image.

[0149] The preset color space may be selected from color spaces in related technologies according to the requirements of actual application scenarios, such as YCrCb space, etc. This embodiment does not limit this.

[0150] Taking the YCrCb space as an example, the RGB data of the first image data is converted into YCbCr data.

[0151] In step S402, a color matching region in the converted image is determined based on a specified color range predefined in the preset color space.

[0152] In this embodiment, after the first image data is converted from the RGB space to the preset color space to obtain a converted image, a color matching area in the converted image may be determined based on a specified color range predefined in the preset color space.

[0153] Still taking the YCrCb space as an example, a specified color range can be predefined based on the preset color space, including a brightness data range (Ymin, Ymax) and a data range selected in the chromaticity data CbCr based on a preset color picking box. On this basis, after converting the RGB data of the first image data into YCbCr data, the YCbCr data can be separated into Y data and CbCr data; and then the area where the Y data is within the above-mentioned preset brightness data range (Ymin, Ymax) and the CbCr data is within the chromaticity data range selected by the above-mentioned preset color picking box can be determined as a color matching area. Exemplarily, the above-mentioned preset color picking box can be Figure 4B The irregular shapes of A1, A2, etc. shown in the figure are not limited in this embodiment.

[0154] In step S403, the area in the first image data corresponding to the color matching area is determined as the designated color area.

[0155] In this embodiment, after the color matching region in the converted image is determined, the first image data may be matched with the color matching region, and the corresponding region may be determined as the designated color region in the first image data.

[0156] From the above description, it can be seen that this embodiment obtains a converted image by converting the first image data from the RGB space to the preset color space, and determines the color matching area in the converted image based on the designated color range predefined in the preset color space, and then determines the area in the first image data corresponding to the color matching area as the designated color area, so as to accurately determine the designated color area in the first image data, and then subsequently determine the purple-fringe area in the first image data based on the first area and the designated color area, so as to subsequently accurately remove the purple-fringe area.

[0157] Figure 5 is a block diagram of an image processing device according to an exemplary embodiment of the present disclosure; the device of this embodiment can be configured in electronic devices, such as servers, workstations, personal computers, mobile terminals (such as mobile phones, cameras, video cameras, tablet computers, etc.), wearable devices (such as glasses, watches, etc.), etc. Figure 5 As shown, the device includes: an image data acquisition module 110, a purple edge region determination module 120, an image data conversion module 130 and an image data correction module 140, wherein:

[0158] The image data acquisition module 110 is used to acquire first image data, where the first image data is image data in RAW format;

[0159] A purple-fringe region determining module 120, configured to determine a purple-fringe region in the first image data;

[0160] An image data conversion module 130, configured to convert the first image data to obtain second image data in a first image format;

[0161] The image data correction module 140 is configured to perform purple-fringing correction on the second image data according to the purple-fringing area to obtain third image data.

[0162] As can be seen from the above description, the device of this embodiment obtains first image data, which is image data in a RAW format, determines a purple-fringed area in the first image data, and then converts the first image data into second image data in the first image format based on the first image data, and then performs purple-fringing correction on the second image data according to the purple-fringed area to obtain third image data. Since the purple-fringed area is determined in the first image data in the RAW format and then the first image data is converted into the second image data, the process of determining the purple-fringed area can be avoided from being affected by the subsequent color processing process, and the subsequent color enhancement of the purple-fringed area can be avoided, thereby reducing the difficulty of subsequent correction of the purple-fringed area, and there is no need to increase the intensity of de-purple fringing, so that the problem of discoloration of some objects in the image can be effectively avoided, thereby achieving the effect of improving image quality.

[0163] Figure 6 2 is a block diagram of another image processing device according to an exemplary embodiment of the present disclosure; the device of this embodiment can be configured in an electronic device, such as a server, a workstation, a personal computer, a mobile terminal (such as a mobile phone, a camera, a video camera, a tablet computer, etc.), a wearable device (such as glasses, watches, etc.), etc. Among them, the image data acquisition module 210, the purple edge area determination module 220, the image data conversion module 230 and the image data correction module 240 are similar to the aforementioned Figure 5 The functions of the image data acquisition module 110 , the purple-fringe region determination module 120 , the image data conversion module 130 and the image data correction module 140 in the illustrated embodiment are the same and will not be described in detail herein.

[0164] like Figure 6 As shown, the device may also include:

[0165] A first processing module 250, configured to perform a first preprocessing on the first image data to obtain first preprocessed image data;

[0166] Furthermore, the purple-fringe region determining module 220 may also be configured to use the first pre-processed image data as the first image data and perform the operation of determining the purple-fringe region in the first image data.

[0167] In some embodiments, the purple-fringe region determination module 220 may include:

[0168] A first determining unit 221 is used to determine a first area in the first image data, where the first area is an area in the first image data where the brightness is greater than or equal to a set brightness threshold and is located at the edge of the photographed object;

[0169] A second determining unit 222 is used to determine a designated color region in the first image data, where the designated color region is a region of a designated color in the first image data;

[0170] The region determining unit 223 is configured to determine a purple-fringe region in the first image data based on the first region and the designated color region.

[0171] In some embodiments, the first determining unit 221 may also be used to:

[0172] Determine a first response map of the first image data based on a preset edge detection operator, where the first response map is used to characterize an area where an edge of a photographed object in the first image data is located;

[0173] Determine a second response map of the first image data based on a preset pixel threshold, wherein the second response map is used to characterize an area in the first image data with a brightness greater than or equal to a set brightness threshold;

[0174] determining a third response map based on the first response map and the second response map, wherein the third response map is used to characterize the first region in the first image data;

[0175] A first region in the first image data is determined based on the third response map.

[0176] In some embodiments, the second determining unit 222 may also be configured to:

[0177] Convert the first image data from the RGB space to a preset color space to obtain a converted image;

[0178] Determining a color matching region in the converted image based on a specified color range predefined in the preset color space;

[0179] An area in the first image data corresponding to the color matching area is determined as the designated color area.

[0180] In some embodiments, the purple-fringe region determination module 220 may further include:

[0181] A second processing unit 224, configured to perform a second preprocessing on the first image data to obtain second preprocessed image data;

[0182] Furthermore, the first determining unit 221 is further configured to use the second pre-processed image data as the first image data and perform the operation of determining the first region in the first image data.

[0183] In some embodiments, the image data conversion module 230 may also be used to perform color processing on the non-purple-fringed region in the second image data to obtain fourth image data;

[0184] Furthermore, the image data correction module 240 may also be configured to use the fourth image data as the second image data and perform the operation of performing purple-fringing correction on the second image data according to the purple-fringing area.

[0185] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0186] Figure 7 900 is a block diagram of an electronic device according to an exemplary embodiment. For example, the device 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0187] Reference Figure 7 , device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .

[0188] The processing component 902 generally controls the overall operation of the device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to perform the above Figures 1A to 4A All or part of the steps of the image processing method of the illustrated embodiment. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.

[0189] The memory 904 is configured to store various types of data to support operations on the device 900. Examples of such data include instructions for any application or method operating on the device 900, contact data, phone book data, messages, image data in a pre-formatted format, pictures, videos, etc. The memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0190] The power supply component 906 provides power to the various components of the device 900. The power supply component 906 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 900.

[0191] The multimedia component 908 includes a screen that provides an output interface between the device 900 and the user. In some embodiments, the screen may include a liquid crystal display panel and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data (e.g., obtaining image data in a format such as RAW, etc.). Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0192] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the device 900 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.

[0193] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0194] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the device 900. For example, the sensor assembly 914 can detect the open / closed state of the device 900, the relative positioning of components, such as the display panel and keypad of the device 900, and the sensor assembly 914 can also detect the position change of the device 900 or a component of the device 900, the presence or absence of user contact with the device 900, the orientation or acceleration / deceleration of the device 900, and the temperature change of the device 900. The sensor assembly 914 can also include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0195] The communication component 916 is configured to facilitate wired or wireless communication between the device 900 and other devices. The device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G or 5G or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0196] In an exemplary embodiment, the device 900 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above Figures 1A to 4A The image processing method of the illustrated embodiment.

[0197] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, which can be executed by the processor 920 of the device 900 to perform the above Figures 1A to 4A The image processing method of the illustrated embodiment. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0198] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0199] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire first image data, where the first image data is image data in a RAW format; determining a purple-fringed region in the first image data; Converting the first image data to obtain second image data in a first image format; Purple fringing correction is performed on the second image data according to the purple fringing area to obtain third image data.

2. The method according to claim 1, characterized in that The method further comprises: Performing a first preprocessing on the first image data to obtain first preprocessed image data; The first pre-processed image data is used as the first image data, and the operation of determining the purple-fringed area in the first image data is performed.

3. The method according to claim 1 or 2, characterized in that: The determining of the purple-fringe area in the first image data comprises: Determine a first area in the first image data, where the first area is an area in the first image data having a brightness greater than or equal to a set brightness threshold and located at an edge of the photographed object; Determine a designated color region in the first image data, wherein the designated color region is a region of a designated color in the first image data; A purple-fringe area in the first image data is determined based on the first area and the designated color area.

4. The method according to claim 3, characterized in that The determining a first area in the first image data comprises: Determine a first response map of the first image data based on a preset edge detection operator, where the first response map is used to characterize an area where an edge of a photographed object in the first image data is located; Determine a second response map of the first image data based on a preset pixel threshold, wherein the second response map is used to characterize an area in the first image data with a brightness greater than or equal to a set brightness threshold; determining a third response map based on the first response map and the second response map, wherein the third response map is used to characterize the first region in the first image data; A first region in the first image data is determined based on the third response map.

5. The method according to claim 3, characterized in that: The determining of the designated color area in the first image data comprises: Convert the first image data from the RGB space to a preset color space to obtain a converted image; Determining a color matching region in the converted image based on a specified color range predefined in the preset color space; An area in the first image data corresponding to the color matching area is determined as the designated color area.

6. The method according to claim 3, characterized in that The method further comprises: Performing second preprocessing on the first image data to obtain second preprocessed image data; The operation of determining the first area in the first image data is performed by using the second pre-processed image data as the first image data.

7. The method according to claim 1, characterized in that The method further comprises: Based on a preset color processing module, color processing is performed on the non-purple-edge region in the second image data to obtain fourth image data; The fourth image data is used as the second image data, and the operation of performing purple-fringe correction on the second image data according to the purple-fringe area is performed.

8. An image processing device, characterized in that: The device comprises: An image data acquisition module, used to acquire first image data, where the first image data is image data in a RAW format; A purple-fringe region determining module, configured to determine a purple-fringe region in the first image data; An image data conversion module, configured to obtain second image data in a first image format based on the first image data; The image data correction module is used to perform purple fringing correction on the second image data according to the purple fringing area to obtain third image data.

9. An electronic device, characterized in that: The device comprises: a processor and a memory for storing a computer program; Wherein, the processor is configured to implement, when executing the computer program: Acquire first image data, where the first image data is image data in a RAW format; determining a purple-fringed region in the first image data; Converting the first image data to obtain second image data in a first image format; Purple fringing correction is performed on the second image data according to the purple fringing area to obtain third image data.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, it realizes: Acquire first image data, where the first image data is image data in a RAW format; determining a purple-fringed region in the first image data; Converting the first image data to obtain second image data in a first image format; Purple fringing correction is performed on the second image data according to the purple fringing area to obtain third image data.

Citation Information

Patent Citations

  • Method for detecting image edge based on Bayer RGB

    CN101465001A

  • Method for eliminating purple edge of image

    CN107864365A

  • Image purple edge elimination device and method

    CN111080559A

  • Image purple edge elimination method and device, terminal and computer readable storage medium

    CN115760599A