Image processing method, device and storage medium

By processing the exposure values ​​of areas with abnormal brightness in HDR images, the problem of uneven brightness in existing technologies is solved, thereby improving image quality.

CN118317197BActive Publication Date: 2026-02-06ZTE CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211726693.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-02-06
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Current exposure technology cannot specifically handle bright scenes, resulting in darker surrounding scenes appearing darker than they actually are, thus reducing the user's photography experience.

Method used

By acquiring high dynamic range (HDR) images, dividing the image according to brightness values, identifying areas of abnormal brightness, determining the target exposure value based on the brightness values, performing image acquisition operations, obtaining an exposure-corrected image, and replacing the areas of abnormal brightness to obtain the target image.

Benefits of technology

This improves image quality, ensures accurate exposure values ​​in areas of abnormal brightness, and results in a fully illuminated image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118317197B_ABST
    Figure CN118317197B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an image processing method, device and storage medium, belonging to the field of image processing. The method comprises obtaining an HDR image of a target object, and performing image division on the HDR image according to the brightness value of the HDR image to obtain a plurality of image regions; determining a brightness abnormal region from the plurality of image regions, and determining a target exposure value of the brightness abnormal region according to the brightness value of the HDR image; performing an image acquisition operation on the target object according to the target exposure value to obtain an exposure correction image; extracting a target image region corresponding to the brightness abnormal region from the exposure correction image, and replacing the brightness abnormal region in the HDR image with the target image region to obtain a target image. The present scheme extracts the target image region corresponding to the brightness abnormal region from the exposure correction image to replace the image of the brightness abnormal region in the HDR image, and obtains a whole image with normal brightness, greatly improving the image quality.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of image processing, and particularly relate to an image processing method, device and storage medium. BACKGROUND

[0002] At present, camera equipment (such as mobile phones, cameras, camcorders and tablet computers) will use automatic exposure to make the photosensitive device obtain a proper exposure amount, and generally the priority of focusing is higher than that of exposure, and the exposure weight of the position of focusing is large, and decreases to the surroundings in turn, if the user is not satisfied with the automatic exposure, the exposure amount can be changed manually. In some shooting scenes (such as night scenes), over-darkness may occur, and for this, a high dynamic range imaging (High Dynamic Range Imaging, HDR) exposure mode is developed, which can synthesize multiple frames of images before and after shooting to obtain an image that makes the user more satisfied.

[0003] However, the existing exposure technologies, such as automatic exposure and HDR, cannot be targeted for exposure, that is, when a scene with a relatively high brightness is photographed, such as a window, an outdoor sunny day, a night light and a working screen, etc., the surrounding scene is darker than the real situation, which greatly reduces the user's shooting experience. SUMMARY

[0004] Embodiments of the present application provide an image processing method, device and storage medium.

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

[0006] obtaining a high dynamic range imaging (HDR) image of a target object, and performing image division on the HDR image according to a brightness value of the HDR image to obtain a plurality of image regions;

[0007] determining a brightness abnormal region from the plurality of image regions, and determining a target exposure value of the brightness abnormal region according to the brightness value of the HDR image;

[0008] performing an image acquisition operation on the target object according to the target exposure value to obtain an exposure correction image;

[0009] extracting a target image region corresponding to the brightness abnormal region from the exposure correction image, and replacing the brightness abnormal region in the HDR image with the target image region to obtain a target image.

[0010] Secondly, embodiments of the present invention also provide a terminal device, the terminal device including a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for implementing communication between the processor and the memory, wherein when the computer program is executed by the processor, it implements the steps of any of the image processing methods provided in this specification.

[0011] Thirdly, embodiments of the present invention also provide a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of any of the image processing methods provided in this specification.

[0012] This invention provides an image processing method, device, and storage medium. The method involves acquiring a high dynamic range (HDR) image of a target object and dividing the HDR image into multiple image regions based on its brightness values. Then, it identifies brightness-abnormal regions from these regions and determines target exposure values ​​for these regions based on the HDR image's brightness values. An image acquisition operation is then performed on the target object based on these target exposure values ​​to obtain an exposure-corrected image. Finally, the target image region corresponding to the brightness-abnormal region is extracted from the exposure-corrected image, and this target image region replaces the brightness-abnormal region in the HDR image, resulting in a target image. This solution utilizes the target exposure values ​​of brightness-abnormal regions in the HDR image, acquires an exposure-corrected image based on these values, and then extracts the target image region corresponding to the brightness-abnormal region from the exposure-corrected image to replace the brightness-abnormal region in the HDR image, resulting in a fully normal-brightness image and significantly improving image quality. Attached Figure Description

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

[0014] Figure 2 for Figure 1 A flowchart illustrating the sub-steps of the image processing method in the image processing diagram;

[0015] Figure 3 This is a schematic diagram of an image segmentation scene provided by an embodiment of the present invention;

[0016] Figure 4 This is another schematic diagram of image segmentation provided in an embodiment of the present invention;

[0017] Figure 5 This is another schematic diagram of image segmentation provided in an embodiment of the present invention;

[0018] Figure 6 Fig. 1 is a schematic diagram of a scene of image merging provided by an embodiment of the present application; Figure 1 Fig. 2 is a schematic diagram of a sub-step flow of the image processing method in Fig. 1;

[0019] Figure 7 Fig. 3 is a schematic diagram of a scene of image merging provided by an embodiment of the present application;

[0020] Figure 8 Fig. 4 is a schematic block diagram of a terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0021] The technical solutions in the embodiments of the present application will be clearly and completely described in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0022] The flowcharts shown in the drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can be further decomposed, combined or partially merged, so the actual execution order can be changed according to the actual situation.

[0023] It should be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0024] The embodiments of the present application provide an image processing method, a device and a storage medium. The image processing method can be applied to a terminal device, which can be a mobile phone, a camera, a camcorder, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant and the like with image acquisition function. For example, the terminal device can be a mobile phone, which acquires a high dynamic range imaging (HDR) image of a target object, divides the HDR image according to the brightness value of the HDR image to obtain a plurality of image regions, determines a brightness abnormal region from the plurality of image regions, determines a target exposure value of the brightness abnormal region according to the brightness value of the HDR image, performs an image acquisition operation on the target object according to the target exposure value to obtain an exposure-corrected image, extracts a target image region corresponding to the brightness abnormal region from the exposure-corrected image, and replaces the brightness abnormal region in the HDR image with the target image region to obtain a target image.

[0025] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments and features in the embodiments can be combined with each other without conflict.

[0026] Referring to Figure 1 , Figure 1 A flowchart of an image processing method provided by an embodiment of the present application is shown.

[0027] As Figure 1 shown, the image processing method comprises steps S101 to S104.

[0028] Step S101, acquiring a high dynamic range imaging (HDR) image of a target object, and performing image division on the HDR image according to luminance values of the HDR image to obtain a plurality of image regions.

[0029] The high dynamic range imaging (HDR) image is an image acquired by a terminal device in an HDR mode.

[0030] In an embodiment, when the terminal device is in the HDR mode, a target object to be photographed is focused, and an image of the target object to be photographed is acquired to obtain an HDR image.

[0031] In an embodiment, as Figure 2 shown, step S101 can comprise sub-steps S1011 to S1012.

[0032] Sub-step S1011, performing image segmentation on the HDR image to obtain a plurality of image units, and determining luminance values of the image units.

[0033] The size of the HDR image segmentation can be set according to actual conditions, and the present embodiment does not make a specific limitation thereon, for example, the HDR image is divided into 100 equal parts in terms of 100*100 granularity, that is, the length and width of the HDR image are both divided into 100 equal parts, and 100*100 image units can be obtained. It should be noted that the stronger the computing power and image processing capability of the terminal device, the larger the segmentation granularity of the HDR image can be, so that the quality of the target image obtained subsequently is higher.

[0034] In an embodiment, a preset segmentation granularity is acquired, and the HDR image is segmented based on the segmentation granularity to obtain a plurality of image units of equal size. The preset segmentation granularity can be set according to actual conditions, and the present embodiment does not make a specific limitation thereon, for example, the preset segmentation granularity can be set to 50*40 granularity, and the efficiency and accuracy of image processing can be improved by segmenting the HDR image.

[0035] In an embodiment, the red value, the green value and the blue value in the RGB mode of the image unit are obtained, and a preset luminance value formula is obtained, wherein the preset luminance value formula is Y=0.299R+0.587G+0.114B, Y is the luminance value, R is the red value, G is the green value, and B is the blue value. The red value, the green value and the blue value in the RGB mode of the image unit are substituted into the preset luminance value formula to obtain the luminance value of the image unit. It should be noted that the parameter value in the preset luminance value formula can be adjusted according to actual conditions, and the embodiment of the present application does not make specific limitation thereto. Based on the preset luminance value formula and the three primary color values of the image unit, the luminance value of the image unit can be accurately obtained.

[0036] In sub-step S1012, the image units are merged according to the luminance values of the image units to obtain a plurality of image regions.

[0037] The image regions at least include one of the following: a first type of luminance abnormal region, a second type of luminance abnormal region and a normal luminance region. The first type of luminance abnormal region is an over-bright image region with a luminance value greater than or equal to a preset first luminance value. The second type of luminance abnormal region is an over-dark image region with a luminance value less than or equal to a preset second luminance value.

[0038] In an embodiment, a first identification value is assigned to the image unit with a luminance value greater than or equal to the preset first luminance value, a second identification value is assigned to the image unit with a luminance value less than or equal to the preset second luminance value, and a third identification value is assigned to the image unit with a luminance value greater than the preset second luminance value and less than the preset first luminance value. The image units are merged according to the first identification value, the second identification value and the third identification value to obtain a plurality of image regions. The preset first luminance value and the preset second luminance value can be set according to actual conditions, and the embodiment of the present application does not make specific limitation thereto. For example, the preset first luminance value can be set to 245, and the preset second luminance value can be set to 25. The image units are labeled and classified according to the luminance values, which can improve the efficiency and accuracy of image region division.

[0039] For example, the HDR image is segmented to obtain 4*6 image units as shown in FIG. 4, the luminance values of the image units are obtained, the image unit with a luminance value greater than or equal to 245 is assigned an identification 1, the image unit with a luminance value less than or equal to 25 is assigned an identification -1, and the image unit with a luminance value greater than 25 and less than 245 is assigned an identification 0 to obtain an image identification map as shown in FIG. 5. Figure 3 Figure 4

[0040] ​​In an embodiment, the way of performing region merging on the plurality of image units according to the first identification value, the second identification value and the third identification value to obtain a plurality of image regions can be: performing region merging on the plurality of image units with the first identification value to obtain at least one first type of abnormal brightness region; performing region merging on the plurality of image units with the second identification value to obtain at least one second type of abnormal brightness region; and performing region merging on the plurality of image units with the third identification value to obtain at least one normal brightness region. By performing region merging on the image units with the same identification value, the efficiency of image processing can be improved.

[0041] In an embodiment, the plurality of image units with the same identification value and the absolute value of the brightness difference value less than or equal to a preset threshold value are performed region merging to obtain a plurality of image regions. The preset threshold value can be set according to actual conditions, which is not specifically limited in the embodiment of the present application. By performing region merging on the plurality of image units with the absolute value of the brightness difference value less than or equal to the preset threshold value, the efficiency of image processing can be improved.

[0042] In an embodiment, the plurality of image units with the first identification value and the absolute value of the brightness difference value less than or equal to a preset threshold value are performed region merging to obtain at least one first type of abnormal brightness region; the plurality of image units with the second identification value and the absolute value of the brightness difference value less than or equal to a preset threshold value are performed region merging to obtain at least one second type of abnormal brightness region; and the plurality of image units with the third identification value and the absolute value of the brightness difference value less than or equal to a preset threshold value are performed region merging to obtain at least one normal brightness region. By performing region merging on the plurality of image units with the absolute value of the brightness difference value less than or equal to the preset threshold value, the efficiency of image processing can be improved.

[0043] In an embodiment, the way of performing region merging on the plurality of image units according to the first identification value, the second identification value and the third identification value to obtain a plurality of image regions can be: performing region merging on the plurality of adjacent image units with the first identification value to obtain at least one first type of abnormal brightness region; performing region merging on the plurality of adjacent image units with the second identification value to obtain at least one second type of abnormal brightness region; and performing region merging on the plurality of adjacent image units with the third identification value to obtain at least one normal brightness region. By performing region merging on the adjacent image units with the same identification value, the efficiency of image processing can be improved.

[0044] For example, the adjacent image units with the identification value of 1 are merged to obtain a first type of abnormal brightness region 10 as shown in FIG. 10A. Figure 4 The adjacent image units with the identification value of 0 are merged to obtain a normal brightness region 20 as shown in FIG. 10B. Figure 5 The adjacent image units with the identification value of 0 are merged to obtain a normal brightness region 20 as shown in FIG. 10B. Figure 4 The adjacent image units with the identification value of 0 are merged to obtain a normal brightness region 20 as shown in FIG. 10B. Figure 5The illustrated normal brightness area 20; to Figure 4 The adjacent image units with the identification of -1 are merged to obtain the second type of abnormal brightness area 30 as shown. Figure 5

[0045] In an embodiment, in the case that there is no image unit with each adjacent image unit forming an image area, the average brightness value of the image area formed by each adjacent image unit with the same identification value is obtained; in the case that the absolute value of the brightness difference value between the brightness value of the image unit and the average brightness value of the image area formed by the adjacent image units is less than or equal to a preset threshold value, the image unit is merged into the image area formed by the adjacent image units. The preset threshold value can be set according to the actual situation, and the embodiment of the present application does not make specific limitation thereto, for example, the preset threshold value can be set to 5. By processing the image unit which is not merged with other image units, the efficiency of image processing can be improved.

[0046] In an embodiment, in the case that it is determined that there is no image area that can be merged, the absolute value of the brightness difference value between the image unit and each image unit is determined, and the image unit with the absolute value of the brightness difference value less than or equal to a preset threshold value is merged to generate an image area. By merging the image units, the efficiency of image processing can be improved.

[0047] It should be noted that if the absolute value of the brightness difference value between the image unit and each adjacent image unit or image area is greater than the preset threshold value, the image unit is separately taken as an image area. If the absolute value of the brightness difference value between the image unit and each adjacent image unit or image area is less than or equal to the preset threshold value, the image unit is merged with the image unit or image area with the minimum absolute value of the brightness difference value.

[0048] Step S102, determining the abnormal brightness area from the plurality of image areas, and determining the target exposure value of the abnormal brightness area according to the brightness value of the HDR image.

[0049] The abnormal brightness area can be one or more, and each abnormal brightness area matches a target exposure value. When the shooting parameter is the target exposure value, the abnormal brightness area of the image becomes a normal brightness area.

[0050] In an embodiment, the identification value assigned to each image area is determined, the image area is determined to be an abnormal brightness area in the case that the identification value assigned to the image area is a first identification value and / or a second identification value, and the image area is determined to be a normal brightness area in the case that the identification value assigned to the image area is a third identification value. According to the identification value assigned to each image area, the abnormal brightness area and the normal brightness area can be accurately distinguished.

[0051] In an embodiment, as shown in Figure 6 ​As shown, step S102 includes sub-step S1021 to sub-step S1022.

[0052] In sub-step S1021, according to the brightness value of the HDR image, the exposure weight value of the brightness abnormal area is determined, and a first exposure value for capturing the HDR image is obtained.

[0053] In an embodiment, the number of image units and the brightness value in the brightness abnormal area are obtained, and a brightness normal area is determined from the plurality of image areas, and the brightness value of the brightness normal area is obtained; according to the number of image units and the brightness value in the brightness abnormal area, and the brightness value of the brightness normal area, the exposure weight value of the brightness abnormal area is determined. By the number of image units and the brightness value in the brightness abnormal area, and the brightness value of the brightness normal area, the exposure weight value of the brightness abnormal area can be accurately determined.

[0054] In an embodiment, the way to determine the exposure weight value of the brightness abnormal area according to the number of image units and the brightness value in the brightness abnormal area, and the brightness value of the brightness normal area can be: dividing the number of image units of each first type of brightness abnormal area by the number of image units of a target first type of brightness abnormal area to obtain a first parameter corresponding to each first type of brightness abnormal area, the target first type of brightness abnormal area is the first type of brightness abnormal area with the most image units, the first type of brightness abnormal area is obtained by image merging of each image unit according to the brightness value of the image unit, and the image unit is obtained by image segmentation of the HDR image; dividing the brightness value of the brightness normal area by the brightness value of the target first type of brightness abnormal area to obtain a second parameter; multiplying the first parameter corresponding to each first type of brightness abnormal area by the second parameter respectively to obtain the exposure weight value corresponding to each first type of brightness abnormal area.

[0055] For example, the number of image units of the first type of brightness abnormal area is A x , the number of image units of the target first type of brightness abnormal area is A i , then the first parameter corresponding to the first type of brightness abnormal area is The brightness value of the brightness normal area is L, and the brightness value of the target first type of brightness abnormal area is n, then the second parameter is The exposure weight value corresponding to the first type of brightness abnormal area is

[0056] It should be noted that in the case of obtaining a plurality of first type of brightness abnormal areas, the ratio processing is performed on the image units of the plurality of first type of brightness abnormal areas, and the number of image units after ratio processing is taken as the calculation number of the plurality of first type of brightness abnormal areas, which can improve the efficiency and accuracy of image processing.

[0057] In an embodiment, the manner of determining the exposure weight value of the luminance abnormal area according to the number of image units in the luminance abnormal area and the luminance value, and the luminance value of the luminance normal area can be: dividing the number of image units of each second-type luminance abnormal area by the number of image units of a target second-type luminance abnormal area to obtain a third parameter corresponding to each second-type luminance abnormal area, the target second-type luminance abnormal area being the second-type luminance abnormal area with the largest number of image units, the second-type luminance abnormal area being obtained by image merging on each image unit according to the luminance value of the image unit; dividing the luminance value of the luminance normal area by the luminance value of the target second-type luminance abnormal area to obtain a fourth parameter; and multiplying the third parameter corresponding to each second-type luminance abnormal area by the fourth parameter to obtain an exposure weight value corresponding to each second-type luminance abnormal area.

[0058] For example, the number of image units of the second-type luminance abnormal area is B x , the number of image units of the target second-type luminance abnormal area is B j , and the third parameter corresponding to each second-type luminance abnormal area is B The luminance value of the luminance normal area is L, the luminance value of the target second-type luminance abnormal area is m, and the fourth parameter is L / m. The exposure weight value corresponding to each second-type luminance abnormal area is B

[0059] It should be noted that in the case of obtaining multiple second-type luminance abnormal areas, the image units of the multiple second-type luminance abnormal areas are subjected to ratio processing, and the number of image units after ratio processing is taken as the calculation number of the multiple second-type luminance abnormal areas, which can improve the efficiency and accuracy of image processing.

[0060] In an embodiment, a first exposure value for collecting an HDR image is obtained, the first exposure value being an exposure value calculated when the terminal device is focused.

[0061] Sub-step S1022: determining a target exposure value of the luminance abnormal area according to the exposure weight value and the first exposure value.

[0062] The exposure weight value corresponding to the luminance abnormal area is multiplied by the first exposure value to obtain the target exposure value of the luminance abnormal area. Multiplying the exposure weight value by the first exposure value can accurately obtain the target exposure value of the luminance abnormal area.

[0063] For example, the exposure weight value corresponding to the first-type luminance abnormal area is B The first exposure value is E, and the target exposure value of the first-type luminance abnormal area is E For example, the exposure weight value corresponding to the second-type luminance abnormal area is B The first exposure value is E, and the target exposure value of the second-type luminance abnormal area is E

[0064] Step S103: Perform an image acquisition operation on the target object according to the target exposure value to obtain an exposure-corrected image.

[0065] After obtaining the target exposure value for the area with abnormal brightness, an image acquisition operation is performed based on the target exposure value to obtain an exposure-corrected image. It should be noted that the number of exposure-corrected images matches the number of areas with abnormal brightness; that is, for every area with abnormal brightness, the number of images acquired from the target object based on the target exposure value is equal to the number of exposure-corrected images. For example, if there are 5 areas with abnormal brightness, images of the target object are acquired based on each target exposure value, resulting in 5 exposure-corrected images.

[0066] Step S104: Extract the target image region corresponding to the brightness abnormal region from the exposure correction image, and replace the brightness abnormal region in the HDR image with the target image region to obtain the target image.

[0067] After acquiring exposure-corrected images based on the target exposure value, target image regions corresponding to the brightness anomalies are extracted from each exposure-corrected image, resulting in multiple target image regions. These target image regions are then used to replace the brightness anomalies in the HDR image, yielding the target image. By extracting the target image regions corresponding to the brightness anomalies from the exposure-corrected images and replacing them with the brightness anomalies in the HDR image, a fully normal image is obtained, significantly improving image quality.

[0068] For example, such as Figure 7 As shown, in the HDR image, region 40 is a first type of brightness aberration region, region 50 is a normal brightness region, and region 60 is a second type of brightness aberration region. An image acquisition operation is performed based on the first type of brightness aberration region to obtain a first exposure-corrected image. An image acquisition operation is performed based on the second type of brightness aberration region to obtain a second exposure-corrected image. A first target image region is extracted from region 40 of the first exposure-corrected image, and a second target image region is extracted from region 60 of the second exposure-corrected image. The first target image region replaces the brightness aberration region of region 40 in the HDR image, and the second target image region replaces the brightness aberration region of region 60 in the HDR image to obtain the target image.

[0069] The image processing method in the above embodiment can accurately obtain a plurality of image regions by acquiring a high dynamic range imaging (HDR) image of a target object, and performing image division on the HDR image according to a brightness value of the HDR image; then determining a brightness abnormal region from the plurality of image regions, and determining a target exposure value of the brightness abnormal region according to the brightness value of the HDR image; performing an image acquisition operation on the target object according to the target exposure value, to obtain an exposure correction image; extracting a target image region corresponding to the brightness abnormal region from the exposure correction image, and replacing the brightness abnormal region in the HDR image with the target image region, to obtain a target image. The scheme obtains an exposure correction image according to the target exposure value of the brightness abnormal region in the HDR image, and extracts a target image region corresponding to the brightness abnormal region from the exposure correction image to replace the image of the brightness abnormal region in the HDR image, to obtain a whole image with normal brightness, greatly improving the image quality.

[0070] Please refer to Figure 8 , Figure 8 A structural schematic block diagram of a terminal device provided by an embodiment of the present application is shown in the figure.

[0071] As Figure 8 shown, the terminal device 200 includes a processor 201 and a memory 202, and the processor 201 and the memory 202 are connected through a bus 203, such as an I2C (Inter-integrated Circuit) bus.

[0072] Specifically, the processor 201 is configured to provide computing and control capabilities to support the operation of the entire terminal device. The processor 201 can be a central processing unit (CPU), and the processor 201 can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0073] Specifically, the memory 202 can be a Flash chip, a read-only memory (ROM) disk, an optical disk, a U disk or a mobile hard disk, etc.

[0074] Those skilled in the art can understand that Figure 8The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the terminal device to which the scheme of the present application is applied. The specific terminal device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0075] The processor is configured to run a computer program stored in the memory and implement any one of the image processing methods provided by the embodiments of the present application when the computer program is executed.

[0076] In an embodiment, the processor 201 is configured to run a computer program stored in the memory and implement the following steps when the computer program is executed:

[0077] obtaining a high dynamic range imaging (HDR) image of a target object, and performing image division on the HDR image according to luminance values of the HDR image to obtain a plurality of image regions;

[0078] determining a luminance abnormal region from the plurality of image regions, and determining a target exposure value of the luminance abnormal region according to the luminance values of the HDR image;

[0079] performing an image acquisition operation on the target object according to the target exposure value to obtain an exposure correction image;

[0080] extracting a target image region corresponding to the luminance abnormal region from the exposure correction image, and replacing the luminance abnormal region in the HDR image with the target image region to obtain a target image.

[0081] In an embodiment, when implementing the image division on the HDR image according to the luminance values of the HDR image to obtain a plurality of image regions, the processor 201 is configured to implement:

[0082] performing image segmentation on the HDR image to obtain a plurality of image units, and determining luminance values of the image units;

[0083] performing image merging on the image units according to the luminance values of the image units to obtain the plurality of image regions.

[0084] In an embodiment, when implementing the image merging on the image units according to the luminance values of the image units to obtain the plurality of image regions, the processor 201 is configured to implement:

[0085] assigning a first identification value to the image unit with a luminance value greater than or equal to a preset first luminance value, and assigning a second identification value to the image unit with a luminance value less than or equal to a preset second luminance value;

[0086] assigning a third identification value to the image unit whose luminance value is greater than a preset second luminance value and less than a preset first luminance value;

[0087] merging the image units according to the first identification value, the second identification value and the third identification value to obtain a plurality of image regions.

[0088] In an embodiment, the processor 201, when implementing the merging the image units according to the first identification value, the second identification value and the third identification value to obtain a plurality of image regions, is configured to implement at least one of the following:

[0089] merging a plurality of the image units with the first identification value to obtain at least one first-type luminance abnormal region;

[0090] merging a plurality of the image units with the second identification value to obtain at least one second-type luminance abnormal region;

[0091] merging a plurality of the image units with the third identification value to obtain at least one normal luminance region.

[0092] In an embodiment, the processor 201, when implementing the merging the image units according to the first identification value, the second identification value and the third identification value to obtain a plurality of image regions, is configured to implement:

[0093] merging a plurality of the image units with the same identification value and whose luminance difference value is less than or equal to a preset threshold to obtain a plurality of image regions.

[0094] In an embodiment, the processor 201, when implementing the merging the image units according to the first identification value, the second identification value and the third identification value to obtain a plurality of image regions, is configured to implement at least one of the following:

[0095] merging a plurality of adjacent image units with the first identification value to obtain at least one first-type luminance abnormal region;

[0096] merging a plurality of adjacent image units with the second identification value to obtain at least one second-type luminance abnormal region;

[0097] merging a plurality of adjacent image units with the third identification value to obtain at least one normal luminance region.

[0098] In an embodiment, the processor 201, when determining the target exposure value of the luminance abnormal area according to the luminance value of the HDR image, is configured to:

[0099] determine an exposure weight value of the luminance abnormal area according to the luminance value of the HDR image, and obtain a first exposure value for capturing the HDR image;

[0100] determine a target exposure value of the luminance abnormal area according to the exposure weight value and the first exposure value.

[0101] In an embodiment, the processor 201, when determining the exposure weight value of the luminance abnormal area according to the luminance value of the image, is configured to:

[0102] obtain the number of image units and the luminance value in the luminance abnormal area, and determine a luminance normal area from a plurality of image areas, and obtain the luminance value of the luminance normal area;

[0103] determine the exposure weight value of the luminance abnormal area according to the number of image units and the luminance value in the luminance abnormal area, and the luminance value of the luminance normal area.

[0104] In an embodiment, the processor 201, when determining the exposure weight value of the luminance abnormal area according to the number of image units and the luminance value in the luminance abnormal area, and the luminance value of the luminance normal area, is configured to:

[0105] divide the number of image units of each first type of luminance abnormal area by the number of image units of a target first type of luminance abnormal area to obtain a first parameter corresponding to each first type of luminance abnormal area, the target first type of luminance abnormal area being the first type of luminance abnormal area with the most image units, the first type of luminance abnormal area being obtained by image merging each image unit according to the luminance value of the image unit, and the image unit being obtained by image segmentation of the HDR image;

[0106] divide the luminance value of the luminance normal area by the luminance value of the target first type of luminance abnormal area to obtain a second parameter;

[0107] multiply the first parameter corresponding to each first type of luminance abnormal area by the second parameter to obtain an exposure weight value corresponding to each first type of luminance abnormal area;

[0108] Divide the image unit quantity of each second type of luminance abnormal area by the image unit quantity of a target second type of luminance abnormal area to obtain a third parameter corresponding to each second type of luminance abnormal area, the target second type of luminance abnormal area being a second type of luminance abnormal area with the largest image unit quantity, and the second type of luminance abnormal area being obtained by image merging according to the luminance value of each image unit;

[0109] Divide the luminance value of the luminance normal area by the luminance value of the target second type of luminance abnormal area to obtain a fourth parameter;

[0110] Multiply the third parameter corresponding to each second type of luminance abnormal area by the fourth parameter to obtain an exposure weight value corresponding to each second type of luminance abnormal area.

[0111] It should be noted that, for the convenience and brevity of description, the specific working process of the terminal device described above can refer to the corresponding process in the foregoing image processing method embodiments, and will not be described here.

[0112] The embodiment of the present application also provides a storage medium for computer readable storage, the storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of any image processing method provided in the specification of the present application.

[0113] The storage medium can be an internal storage unit of the terminal device, such as a hard disk or a memory of the terminal device. The storage medium can also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc.

[0114] Those skilled in the art can understand that all or some of the steps in the methods disclosed above, the functional modules / units in the systems and devices can be implemented by software, firmware, hardware, or a combination thereof. In hardware implementation, the split between the functional modules / units referred to in the above description does not necessarily correspond to the split between physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components working together. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on computer readable media, which can include computer storage media (or non-transitory media), and communication media (or transitory media). As is well known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Further, it is common knowledge to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.

[0115] It should be understood that the term "and / or" as used herein refers to any combination of associated listed items, and all possible combinations, and includes these combinations. It should be noted that the terms "comprising", "including", or any other variant thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article or system that comprises a list of elements does not include only those elements, but can also include other elements not expressly listed or inherent to such process, method, article or system. Without more limitations, an element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article or system including the element.

[0116] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments. The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.

Claims

1. An image processing method, characterized by, The method comprises the following steps: acquiring a high dynamic range imaging (HDR) image of a target object, performing image segmentation on the HDR image to obtain a plurality of image units, and determining the brightness values of the image units; assigning a first identification value to the image units with a brightness value greater than or equal to a preset first brightness value, and assigning a second identification value to the image units with a brightness value less than or equal to a preset second brightness value; assigning a third identification value to the image units with a brightness value greater than the preset second brightness value and less than the preset first brightness value; performing region merging on the plurality of image units according to the first identification value, the second identification value, and the third identification value to obtain a plurality of image regions; determining a brightness abnormal region from the plurality of image regions, and determining a target exposure value of the brightness abnormal region according to the brightness value of the HDR image; performing an image acquisition operation on the target object according to the target exposure value to obtain an exposure correction image; extracting a target image region corresponding to the brightness abnormal region from the exposure correction image, and replacing the brightness abnormal region in the HDR image with the target image region to obtain a target image.

2. The image processing method of claim 1, wherein, The region merging on the plurality of image units according to the first identification value, the second identification value, and the third identification value to obtain a plurality of image regions comprises at least one of the following: performing region merging on a plurality of image units with the first identification value to obtain at least one first-type brightness abnormal region; performing region merging on a plurality of image units with the second identification value to obtain at least one second-type brightness abnormal region; performing region merging on a plurality of image units with the third identification value to obtain at least one brightness normal region.

3. The image processing method of claim 1, wherein, The region merging on the plurality of image units according to the first identification value, the second identification value, and the third identification value to obtain a plurality of image regions comprises: performing region merging on a plurality of image units with the same identification value and an absolute value of a brightness difference less than or equal to a preset threshold to obtain a plurality of image regions.

4. The image processing method according to claim 1, characterized in that, The region merging on the plurality of image units according to the first identification value, the second identification value, and the third identification value to obtain a plurality of image regions comprises at least one of the following: performing region merging on a plurality of adjacent image units with the first identification value to obtain at least one first-type brightness abnormal region; performing region merging on a plurality of adjacent image units with the second identification value to obtain at least one second-type brightness abnormal region; performing region merging on a plurality of adjacent image units with the third identification value to obtain at least one brightness normal region.

5. The image processing method of claim 1, wherein, The determination of the target exposure value of the brightness abnormal region according to the brightness value of the HDR image comprises: determining an exposure weight value of the brightness abnormal region according to the brightness value of the HDR image, and acquiring a first exposure value for acquiring the HDR image; determining the target exposure value of the brightness abnormal region according to the exposure weight value and the first exposure value.

6. The image processing method of claim 5, wherein, The exposure weight value of the luminance abnormal area is determined according to the luminance value of the HDR image, and the exposure weight value of the luminance abnormal area is determined according to the number of image units and the luminance value of the luminance abnormal area and the luminance value of the luminance normal area. The number of image units and the luminance value in the luminance abnormal area are obtained, and a luminance normal area is determined from a plurality of image areas, and the luminance value of the luminance normal area is obtained. The exposure weight value of the luminance abnormal area is determined according to the number of image units and the luminance value of the luminance abnormal area and the luminance value of the luminance normal area.

7. The image processing method of claim 6, wherein, The exposure weight value of the luminance abnormal area is determined according to the number of image units and the luminance value of the luminance abnormal area and the luminance value of the luminance normal area. The number of image units of each first-type luminance abnormal area is divided by the number of image units of a target first-type luminance abnormal area to obtain a first parameter corresponding to each first-type luminance abnormal area, the target first-type luminance abnormal area is a first-type luminance abnormal area with the most image units, the first-type luminance abnormal area is obtained by image merging of each image unit according to the luminance value of the image unit, and the image unit is obtained by image segmentation of the HDR image; The luminance value of the luminance normal area is divided by the luminance value of the target first-type luminance abnormal area to obtain a second parameter; The first parameter corresponding to each first-type luminance abnormal area is multiplied by the second parameter to obtain an exposure weight value corresponding to each first-type luminance abnormal area; The number of image units of each second-type luminance abnormal area is divided by the number of image units of a target second-type luminance abnormal area to obtain a third parameter corresponding to each second-type luminance abnormal area, the target second-type luminance abnormal area is a second-type luminance abnormal area with the most image units, and the second-type luminance abnormal area is obtained by image merging of each image unit according to the luminance value of the image unit; The luminance value of the luminance normal area is divided by the luminance value of the target second-type luminance abnormal area to obtain a fourth parameter; The third parameter corresponding to each second-type luminance abnormal area is multiplied by the fourth parameter to obtain an exposure weight value corresponding to each second-type luminance abnormal area.

8. A terminal device, comprising: The terminal device comprises a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for realizing connection communication between the processor and the memory, wherein the computer program is executed by the processor to realize the steps of the image processing method according to any one of claims 1 to 7.

9. A storage medium for computer-readable storage, characterized in that, The storage medium stores one or more programs executable by one or more processors to realize the steps of the image processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Imaging method and device, electronic equipment and storage medium

    CN114422721A