Image brightness matching method, device, storage medium and computer program product

By acquiring and smoothing the brightness difference in image processing, and combining contrast and brightness adjustment, the brightness tomography problem caused by histogram matching is solved, achieving a more natural and clear image matching effect.

CN115063306BActive Publication Date: 2025-01-17BEIJING JIGAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210581952.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2025-01-17
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

During the image processing, the brightness tomography caused by the existing histogram matching method makes the image not natural enough after processing.

Method used

By obtaining the brightness difference between the image to be processed and the reference image, and smoothing the brightness difference at each pixel position, brightness adjustment is performed according to the smoothing result, ensuring the brightness matching of the image, while optionally performing contrast and brightness pre-adjustment. Extract high-frequency information to enhance texture features.

Benefits of technology

A more natural and clear image matching effect is achieved, which avoids brightness tomography and improves the quality of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115063306B_ABST
    Figure CN115063306B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a brightness matching method for an image, an electronic device, a storage medium and a computer program product. The method comprises: when the brightness difference between the image to be processed and the reference image is less than the target brightness difference, obtaining the brightness difference between the pixel pairs corresponding to the same pixel position on the image to be processed and the reference image; smoothing the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result; and adjusting the brightness of the image to be processed according to the brightness difference smoothing result to obtain a processed image that matches the brightness of the reference image. The embodiment of the present invention can obtain a processed image that matches the brightness of the reference image and is clear and natural, avoiding the phenomenon of brightness fault.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of image processing technology, and in particular to an image brightness matching method, electronic equipment, storage medium and computer program product. Background Art

[0002] In the field of image processing technology, in image processing processes such as image fusion and image registration, it is necessary to match the brightness of different images. For brightness matching, the target generally adopts a histogram matching method, which specifically includes: transforming the histogram of the image to be processed based on the histogram of the standard image, so that the histograms of the two images are the same and similar, so that the two images have similar tones and contrasts.

[0003] However, brightness faults are prone to occur in the processed images obtained using the histogram matching method, resulting in the processed images not being natural enough.

[0004] Therefore, there is an urgent need for a new image brightness matching method to solve or partially solve the problems existing in the related technology. Summary of the invention

[0005] The embodiments of the present invention provide a brightness matching method for an image, an electronic device, a storage medium and a computer program product to avoid brightness faults in an image after brightness matching processing.

[0006] A first aspect of an embodiment of the present invention provides a brightness matching method for an image, the method comprising:

[0007] When the brightness difference between the image to be processed and the reference image is less than the target brightness difference, obtaining the brightness difference between the pair of pixels corresponding to the same pixel position on the image to be processed and the reference image;

[0008] Smoothing the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result;

[0009] According to the brightness difference smoothing result, the brightness of the image to be processed is adjusted to obtain a processed image whose brightness matches that of the reference image.

[0010] Optionally, when the brightness difference between the image to be processed and the reference image is not less than the target brightness difference, the method further includes:

[0011] Pre-adjusting the contrast and brightness of the image to be processed to obtain a pre-adjusted image;

[0012] Obtaining the brightness difference between the pixel pairs corresponding to the same pixel position on the image to be processed and the reference image, and performing brightness adjustment on the image to be processed, comprising:

[0013] The brightness difference between the pre-adjusted image and the pair of pixels corresponding to the same pixel position on the reference image is obtained, and the brightness of the pre-adjusted image is adjusted.

[0014] Optionally, before pre-adjusting the contrast and brightness of the image to be processed, the method further includes:

[0015] Extracting high-frequency information of the image to be processed to obtain a high-frequency information image of the image to be processed;

[0016] Pre-adjusting the contrast and brightness of the image to be processed to obtain a pre-adjusted image includes:

[0017] Pre-adjusting the contrast and brightness of the image to be processed to obtain an initial image after pre-adjustment;

[0018] The texture features of the pre-adjusted initial image are enhanced by using the high-frequency information image to obtain the pre-adjusted image.

[0019] Optionally, pre-adjusting the contrast and brightness of the image to be processed includes:

[0020] Determining an adjustment factor according to a brightness difference between the two images to be matched;

[0021] Obtaining a contrast adjustment parameter and a brightness adjustment parameter according to the adjustment factor and the brightness parameter of the image to be processed;

[0022] According to the contrast adjustment parameter and the brightness adjustment parameter, the contrast and brightness of the image to be processed are pre-adjusted.

[0023] Optionally, obtaining a contrast adjustment parameter and a brightness adjustment parameter according to the adjustment factor and a brightness parameter of the image to be processed includes:

[0024] Obtaining the contrast adjustment parameter according to the adjustment factor and the maximum brightness and the minimum brightness of the image to be processed;

[0025] The brightness adjustment parameter is obtained according to the contrast adjustment parameter and the maximum brightness of the image to be processed.

[0026] Optionally, smoothing the brightness difference of each pixel position in each target area on the brightness difference image to obtain a brightness difference smoothing result includes:

[0027] Smoothing the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result, and obtaining a local average brightness difference of the target area;

[0028] The local average brightness difference of the target area where each pixel position is located is determined as the brightness of the pixel point at the pixel position in the brightness difference smoothed image to obtain the brightness difference smoothed image.

[0029] Optionally, according to the brightness difference smoothing result, adjusting the brightness of the image to be processed to obtain a processed image whose brightness matches that of the reference image includes:

[0030] For each pixel point at a pixel position in the image to be processed, the brightness of the pixel point at the pixel position in the image to be processed is adjusted by taking the local average brightness difference of the target area where the pixel position is located in the image after brightness difference smoothing as the brightness adjustment amount.

[0031] Optionally, the image to be processed and the reference image are two images that have been pre-registered.

[0032] A second aspect of an embodiment of the present invention provides a brightness matching device for an image, the device comprising:

[0033] An acquisition module, configured to acquire a brightness difference between a pair of pixels corresponding to the same pixel position on the image to be processed and the reference image when the brightness difference between the image to be processed and the reference image is less than a target brightness difference;

[0034] A smoothing module is used to smooth the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result;

[0035] The adjustment module is used to adjust the brightness of the image to be processed according to the brightness difference smoothing result to obtain a processed image whose brightness matches that of the reference image.

[0036] Optionally, the device further comprises:

[0037] A pre-adjustment module, used for pre-adjusting the contrast and brightness of the image to be processed to obtain a pre-adjusted image;

[0038] The acquisition module and the adjustment module are specifically used for:

[0039] The brightness difference between the pre-adjusted image and the pair of pixels corresponding to the same pixel position on the reference image is obtained, and the brightness of the pre-adjusted image is adjusted.

[0040] Optionally, the device further comprises:

[0041] An extraction module, used for extracting high-frequency information of the image to be processed to obtain a high-frequency information image of the image to be processed;

[0042] The pre-adjustment module is specifically used for:

[0043] Pre-adjusting the contrast and brightness of the image to be processed to obtain an initial image after pre-adjustment;

[0044] The texture features of the pre-adjusted initial image are enhanced by using the high-frequency information image to obtain the pre-adjusted image.

[0045] Optionally, pre-adjusting the contrast and brightness of the image to be processed includes:

[0046] Determining an adjustment factor according to a brightness difference between the two images to be matched;

[0047] Obtaining a contrast adjustment parameter and a brightness adjustment parameter according to the adjustment factor and the brightness parameter of the image to be processed;

[0048] According to the contrast adjustment parameter and the brightness adjustment parameter, the contrast and brightness of the image to be processed are pre-adjusted.

[0049] Optionally, obtaining a contrast adjustment parameter and a brightness adjustment parameter according to the adjustment factor and a brightness parameter of the image to be processed includes:

[0050] Obtaining the contrast adjustment parameter according to the adjustment factor and the maximum brightness and the minimum brightness of the image to be processed;

[0051] The brightness adjustment parameter is obtained according to the contrast adjustment parameter and the maximum brightness of the image to be processed.

[0052] Optionally, the smoothing module is specifically used to:

[0053] Averaging the brightness differences of each pixel position in each target area on the brightness difference image to obtain a local average brightness difference of the target area;

[0054] The local average brightness difference of the target area where each pixel position is located is determined as the brightness of the pixel point at the pixel position in the brightness difference smoothed image to obtain the brightness difference smoothed image.

[0055] Optionally, the adjustment module is specifically used to:

[0056] For each pixel point at a pixel position in the image to be processed, the brightness of the pixel point at the pixel position in the image to be processed is adjusted by taking the local average brightness difference of the target area where the pixel position is located in the image after brightness difference smoothing as the brightness adjustment amount.

[0057] Optionally, the image to be processed and the reference image are two images that have been pre-registered.

[0058] A third aspect of an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the image brightness matching method as described in the first aspect of the present invention.

[0059] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the image brightness matching method as described in the first aspect of the present invention is implemented.

[0060] A fifth aspect of an embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the image brightness matching method described in the first aspect of the present invention.

[0061] In the embodiment of the present invention, when the brightness difference between the image to be processed and the reference image is less than the target brightness difference, the brightness difference between the pixel pairs corresponding to the same pixel position on the image to be processed and the reference image is obtained; the brightness difference of each pixel position in each target area is smoothed to obtain a brightness difference smoothing result; according to the brightness difference smoothing result, the brightness of the image to be processed is adjusted to obtain a processed image that matches the brightness of the reference image. In the embodiment of the present invention, the brightness of the image to be processed is adjusted from the perspective of pixel brightness difference, and the processed image finally obtained is clearer and more natural than the matched image obtained by the histogram matching method, and the brightness fault phenomenon is avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0063] Figure 1 It is a schematic diagram of a communication process of a brightness matching system of an image according to an embodiment of the present invention;

[0064] Figure 2 is a flow chart of another image brightness matching method according to an embodiment of the present invention;

[0065] Figure 3 is a flow chart of another image brightness matching method according to an embodiment of the present invention;

[0066] Figure 4 is a schematic diagram of an adjusted grayscale image obtained by using a brightness matching method of an image according to an embodiment of the present invention;

[0067] Figure 5 is a schematic diagram of a processed grayscale image obtained by using a brightness matching method of an image according to an embodiment of the present invention;

[0068] Figure 6 It is a structural block diagram of a brightness matching device for an image according to an embodiment of the present invention. DETAILED DESCRIPTION

[0069] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0070] Reference Figure 1 , shows a flow chart of a brightness matching method of an image according to an embodiment of the present invention, the method comprising the following steps:

[0071] S101, when the brightness difference between the image to be processed and the reference image is less than the target brightness difference, obtaining the brightness difference between a pair of pixels corresponding to the same pixel position on the image to be processed and the reference image.

[0072] The image brightness matching method provided in the embodiment of the present invention can be used as a preprocessing step for image fusion, that is, the image to be processed and the reference image can be any two images with brightness differences. After the two images are brightness matched using the method provided in the embodiment of the present invention, the two images with matching brightness are then fused.

[0073] In an optional embodiment of the present invention, the image to be processed and the reference image are two images that have been pre-registered. Generally speaking, the image with higher brightness of the two images can be used as the reference image, and the image with lower brightness can be used as the image to be processed, so that the brightness of the image with lower brightness is adjusted to match the brightness of the image with higher brightness.

[0074] Specifically, the image brightness matching method provided in the embodiment of the present invention can be executed after image registration, that is, firstly register two images with brightness difference, and then perform brightness matching on the two registered images using the method provided in the embodiment of the present invention.

[0075] In the embodiment of the present invention, the brightness difference between the pixel pairs corresponding to the same pixel position on the image to be processed and the reference image may be obtained, so as to perform brightness matching based on the brightness difference.

[0076] Optionally, in an embodiment of the present invention, the image brightness can be represented by a grayscale value, so that the grayscale difference between the grayscale value of each pixel of the image to be processed and the grayscale value of each pixel of the reference grayscale image can be determined one by one, thereby determining the brightness difference between the pixel point pairs corresponding to the same pixel position on the image to be processed and the reference image. Optionally, in the case where both the image to be processed and the reference image are RGB images, the RGB image can be converted into a grayscale image according to the method in the relevant technology, and then the brightness difference between the two can be determined according to the aforementioned method.

[0077] S102, smoothing the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result.

[0078] In the embodiment of the present invention, a common smoothing operation can be used to blur the brightness difference to reduce noise and reduce the level of detail. The effect of blurring the brightness difference is to adjust the brightness of the local area as a whole to prevent the details of the adjusted image from being worse than those before the adjustment. The embodiment of the present invention does not impose any specific restrictions on this.

[0079] In an optional implementation manner, the step S102 includes the following sub-steps:

[0080] S1021, smoothing the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result, and obtaining a local average brightness difference of the target area.

[0081] S1022, determining the local average brightness difference of the target area where each pixel position is located as the brightness of the pixel point at the pixel position in the brightness difference smoothed image, to obtain the brightness difference smoothed image.

[0082] In the embodiment of the present invention, the brightness difference may be expressed as a brightness difference image, and thus, smoothing the brightness difference at each pixel position in each target area may specifically be a box filter operation to obtain a box filtered image.

[0083] In an optional implementation manner, the step S1022 includes the following sub-steps:

[0084] S11211, performing a down-sampling operation on the frame-filtered image to obtain a down-sampled image.

[0085] In the embodiment of the present invention, downsampling can be generally understood as reducing the size of an image, also known as downsampling. In the embodiment of the present invention, the image after the box filtering can be downsampled to 1 / 8 of its size.

[0086] S11212, performing Gaussian blur processing on the down-sampled image to obtain a blurred difference image.

[0087] S1213, performing an up-sampling operation on the blur difference to obtain a brightness difference smoothed image, wherein the size enlargement degree of the up-sampling operation corresponds to the size reduction degree of the down-sampling operation.

[0088] In the embodiment of the present invention, upsampling can be generally understood as enlarging an image, and can also be referred to as image interpolation. In the embodiment of the present invention, the blurred grayscale image can be restored to its original size by performing an upsampling operation on the blurred grayscale image.

[0089] S103: According to the brightness difference smoothing result, adjust the brightness of the image to be processed to obtain a processed image whose brightness matches that of the reference image.

[0090] Specifically, in the embodiment of the present invention, the brightness difference smoothing result may be superimposed on the image to be processed according to the pixel position of each pixel to obtain a processed image whose brightness matches that of the reference image.

[0091] Step S103 may specifically include the following sub-steps:

[0092] For each pixel point at a pixel position in the image to be processed, the brightness of the pixel point at the pixel position in the image to be processed is adjusted by taking the local average brightness difference of the target area where the pixel position is located in the image after brightness difference smoothing as the brightness adjustment amount.

[0093] In the embodiment of the present invention, the processed image finally obtained is clearer and more natural than the matched image obtained by using the histogram matching method, and the brightness fault phenomenon is avoided.

[0094] In an optional implementation, another brightness matching method of an image according to an embodiment of the present invention is disclosed, such as Figure 2 As shown, the method comprises the following steps:

[0095] S201 , when the brightness difference between the image to be processed and the reference image is not less than the target brightness difference, pre-adjust the contrast and brightness of the image to be processed to obtain a pre-adjusted image.

[0096] In an embodiment of the present invention, when there is a large brightness difference between the image to be processed and the reference image, the contrast and brightness of the image to be processed may be pre-adjusted so that the brightness difference between the two images is closer before performing a subsequent brightness matching process.

[0097] In the embodiment of the present invention, the specific solution for pre-adjusting the contrast and brightness of the image to be processed may refer to any feasible method in the related art.

[0098] S202, obtaining a brightness difference between a pair of pixels corresponding to the same pixel position on the pre-adjusted image and the reference image.

[0099] S203, smoothing the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result.

[0100] S204: Perform brightness adjustment on the pre-adjusted image according to the brightness difference smoothing result to obtain a processed image whose brightness matches that of the reference image.

[0101] Steps S202 - S204 are similar to the above-mentioned steps S101 - S103 , and will not be described in detail in this embodiment of the present invention.

[0102] In the embodiment of the present invention, when the brightness difference between the image to be processed and the reference image is large, the contrast and brightness of the image to be processed can be pre-adjusted to make the brightness of the image to be processed close to that of the reference image while maintaining the image clarity. In this way, the brightness difference between the image to be processed and the reference image can be reduced, so that the subsequent brightness adjustment has less impact on the image.

[0103] In an optional implementation, another image brightness matching method of an embodiment of the present invention is disclosed, and the method is applied when the brightness difference between the image to be processed and the reference image is not less than the target brightness difference, such as Figure 3 As shown, the method comprises the following steps:

[0104] S301, extracting high-frequency information of the image to be processed to obtain a high-frequency information image of the image to be processed.

[0105] In an embodiment of the present invention, before extracting high-frequency information of the image to be processed, the grayscale image to be processed may be subjected to self-guided filtering using a fast guided filter (fastGuidedFilter), wherein the fastGuiededFilter parameter is set to: filter radius r = 0.04*max(wide, height), wide and height are respectively the width and height of the grayscale image to be processed, and the filter parameter eps is set to 0.01.

[0106] The high-frequency information image of the image to be processed is determined by using the image to be processed and the image after the self-guided filtering.

[0107] In the embodiment of the present invention, the image to be processed and the image after the self-guided filtering can also be subjected to contrast compression to reduce the amount of data calculation. The contrast compression can be specifically embodied as: taking the logarithm of the grayscale of each pixel.

[0108] In the embodiment of the present invention, in order to prevent the grayscale value of the pixel from being negative after contrast compression, a target value may be added to the grayscale of each pixel, wherein the target value may be 1.

[0109] S302, pre-adjusting the contrast and brightness of the image to be processed to obtain an initial image after pre-adjustment.

[0110] In the embodiment of the present invention, step S302 specifically includes the following sub-steps:

[0111] S3021: Determine an adjustment factor according to the brightness difference between the two images to be matched.

[0112] In the embodiment of the present invention, the adjustment factor may represent the brightness difference between the two images to be matched. For example, if the brightness difference between the two images to be matched is larger, the adjustment factor is larger.

[0113] S3022: Obtain a contrast adjustment parameter and a brightness adjustment parameter according to the adjustment factor and the brightness parameter of the image to be processed.

[0114] In the embodiment of the present invention, the contrast adjustment parameter and the brightness adjustment parameter can be determined according to the brightness difference between the two images to be matched and the actual brightness parameters of the image to be processed (e.g., average brightness, maximum brightness, minimum brightness, etc.), so as to adjust the contrast and brightness of the image to be processed so that the brightness difference between the image to be processed and the reference image is close.

[0115] The above step S3022 may specifically include: obtaining the contrast adjustment parameter according to the adjustment factor and the maximum brightness and the minimum brightness of the image to be processed; and obtaining the brightness adjustment parameter according to the contrast adjustment parameter and the maximum brightness of the image to be processed.

[0116] For example, the contrast adjustment parameter may be: beta = log(4) / (maxval-minval), where maxval and minval are respectively: the maximum grayscale value and the minimum grayscale value of the image to be processed. The brightness adjustment parameter may be: gamma = (1-beta) / maxval.

[0117] S3023: Pre-adjust the contrast and brightness of the image to be processed according to the contrast adjustment parameter and the brightness adjustment parameter.

[0118] For example, the grayscale of the initial image after pre-adjustment = beta*image to be processed+gamma.

[0119] S303: using the high-frequency information image, enhancing the texture features of the pre-adjusted initial image to obtain the pre-adjusted image.

[0120] Specifically, the high-frequency information image can be superimposed on the pre-adjusted initial image to obtain the pre-adjusted image, so as to enhance the texture features of the image, so as to maintain the image clarity while adjusting the contrast and brightness of the image to be processed.

[0121] like Figure 4 As shown, Figure 4 A schematic diagram of an adjusted grayscale image obtained by using a brightness matching method for an image according to an embodiment of the present invention is shown. Figure 4 The image on the left is the image to be processed, and the image on the right is the adjusted grayscale image. It can be seen from the figure that after adjusting the contrast and brightness, the adjusted grayscale image has improved contrast and brightness and is clearer than the image to be processed.

[0122] S304: Obtain a brightness difference between a pair of pixels corresponding to the same pixel position on the pre-adjusted image and the reference image.

[0123] S305, smoothing the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result.

[0124] S306: Perform brightness adjustment on the pre-adjusted image according to the brightness difference smoothing result to obtain a processed image whose brightness matches that of the reference image.

[0125] Steps S304-S306 are similar to the above-mentioned steps S202-S204, and will not be described in detail in this embodiment of the present invention.

[0126] like Figure 5 As shown, Figure 5 A schematic diagram of a processed grayscale image obtained by using a brightness matching method of an image according to an embodiment of the present invention is shown. Figure 5 The image on the left is the grayscale image after adjustment, and the image on the right is the grayscale image after processing. It can be seen from the figure that the processed grayscale image obtained by superimposing the fuzzy grayscale difference image is clearer and more natural, and there is no brightness fault image.

[0127] Based on the same inventive concept, an embodiment of the present invention provides a brightness matching device for an image. Figure 6 , Figure 6 Schematic diagram of a brightness matching device for an image provided by an embodiment of the present invention. Figure 6 As shown, the device comprises:

[0128] The device comprises:

[0129] An acquisition module 601 is used to acquire a brightness difference between a pair of pixels corresponding to the same pixel position on the image to be processed and the reference image when the brightness difference between the image to be processed and the reference image is less than a target brightness difference;

[0130] A smoothing module 602 is used to smooth the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result;

[0131] The adjustment module 603 is used to adjust the brightness of the image to be processed according to the brightness difference smoothing result to obtain a processed image whose brightness matches that of the reference image.

[0132] Optionally, the device further comprises:

[0133] A pre-adjustment module, used for pre-adjusting the contrast and brightness of the image to be processed to obtain a pre-adjusted image;

[0134] The acquisition module and the adjustment module are specifically used for:

[0135] The brightness difference between the pre-adjusted image and the pair of pixels corresponding to the same pixel position on the reference image is obtained, and the brightness of the pre-adjusted image is adjusted.

[0136] Optionally, the device further comprises:

[0137] An extraction module, used for extracting high-frequency information of the image to be processed to obtain a high-frequency information image of the image to be processed;

[0138] The pre-adjustment module is specifically used for:

[0139] Pre-adjusting the contrast and brightness of the image to be processed to obtain an initial image after pre-adjustment;

[0140] The texture features of the pre-adjusted initial image are enhanced by using the high-frequency information image to obtain the pre-adjusted image.

[0141] Optionally, pre-adjusting the contrast and brightness of the image to be processed includes:

[0142] Determining an adjustment factor according to a brightness difference between the two images to be matched;

[0143] Obtaining a contrast adjustment parameter and a brightness adjustment parameter according to the adjustment factor and the brightness parameter of the image to be processed;

[0144] According to the contrast adjustment parameter and the brightness adjustment parameter, the contrast and brightness of the image to be processed are pre-adjusted.

[0145] Optionally, obtaining a contrast adjustment parameter and a brightness adjustment parameter according to the adjustment factor and a brightness parameter of the image to be processed includes:

[0146] Obtaining the contrast adjustment parameter according to the adjustment factor and the maximum brightness and the minimum brightness of the image to be processed;

[0147] The brightness adjustment parameter is obtained according to the contrast adjustment parameter and the maximum brightness of the image to be processed.

[0148] Optionally, the smoothing module 602 is specifically configured to:

[0149] Averaging the brightness differences of each pixel position in each target area on the brightness difference image to obtain a local average brightness difference of the target area;

[0150] The local average brightness difference of the target area where each pixel position is located is determined as the brightness of the pixel point at the pixel position in the brightness difference smoothed image to obtain the brightness difference smoothed image.

[0151] Optionally, the adjustment module 603 is specifically configured to:

[0152] For each pixel point at a pixel position in the image to be processed, the brightness of the pixel point at the pixel position in the image to be processed is adjusted by taking the local average brightness difference of the target area where the pixel position is located in the image after brightness difference smoothing as the brightness adjustment amount.

[0153] Optionally, the image to be processed and the reference image are two images that have been pre-registered.

[0154] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0155] An embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein when the processor is executed, the steps in the image brightness matching method described in any of the above embodiments are implemented.

[0156] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps in the image brightness matching method described in any of the above embodiments are implemented.

[0157] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the image brightness matching method described in any of the above embodiments when executed by a processor.

[0158] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0159] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0160] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0161] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0162] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.

[0163] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0164] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0165] The above is a detailed introduction to the brightness matching method of an image, an electronic device, a storage medium and a computer program product provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A brightness matching method for an image, characterized in that: The method comprises: When the brightness difference between the image to be processed and the reference image is less than the target brightness difference, obtaining the brightness difference between the pair of pixels corresponding to the same pixel position on the image to be processed and the reference image; Smoothing the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result; According to the brightness difference smoothing result, the brightness of the image to be processed is adjusted to obtain a processed image whose brightness matches that of the reference image.

2. The method according to claim 1, characterized in that In a case where the brightness difference between the image to be processed and the reference image is not less than the target brightness difference, the method further includes: Pre-adjusting the contrast and brightness of the image to be processed to obtain a pre-adjusted image; Obtaining the brightness difference between the pixel pairs corresponding to the same pixel position on the image to be processed and the reference image, and performing brightness adjustment on the image to be processed, comprising: The brightness difference between the pre-adjusted image and the pair of pixels corresponding to the same pixel position on the reference image is obtained, and the brightness of the pre-adjusted image is adjusted.

3. The method according to claim 2, characterized in that Before pre-adjusting the contrast and brightness of the image to be processed, the method further includes: Extracting high-frequency information of the image to be processed to obtain a high-frequency information image of the image to be processed; Pre-adjusting the contrast and brightness of the image to be processed to obtain a pre-adjusted image includes: Pre-adjusting the contrast and brightness of the image to be processed to obtain an initial image after pre-adjustment; The texture features of the pre-adjusted initial image are enhanced by using the high-frequency information image to obtain the pre-adjusted image.

4. The method according to claim 2 or 3, characterized in that: Pre-adjusting the contrast and brightness of the image to be processed includes: Determining an adjustment factor according to a brightness difference between the image to be processed and the reference image; Obtaining a contrast adjustment parameter and a brightness adjustment parameter according to the adjustment factor and the brightness parameter of the image to be processed; According to the contrast adjustment parameter and the brightness adjustment parameter, the contrast and brightness of the image to be processed are pre-adjusted.

5. The method according to claim 4, characterized in that According to the adjustment factor and the brightness parameter of the image to be processed, a contrast adjustment parameter and a brightness adjustment parameter are obtained, including: Obtaining the contrast adjustment parameter according to the adjustment factor and the maximum brightness and the minimum brightness of the image to be processed; The brightness adjustment parameter is obtained according to the contrast adjustment parameter and the maximum brightness of the image to be processed.

6. The method according to any one of claims 1 to 5, characterized in that: The brightness difference of each pixel position in each target area is smoothed to obtain the brightness difference smoothing result, including: Smoothing the brightness difference of each pixel position in each target area to obtain a brightness difference smoothing result, and obtaining a local average brightness difference of the target area; The local average brightness difference of the target area where each pixel position is located is determined as the brightness of the pixel point at the pixel position in the smoothed image, and a brightness difference smoothed image is obtained.

7. The method according to claim 6, characterized in that The two images to be matched include the image to be processed and the reference image, and according to the brightness difference smoothing result, the image to be processed with lower brightness among the two images to be matched is brightness adjusted, including: For each pixel point at a pixel position in the image to be processed, the brightness of the pixel point at the pixel position in the image to be processed is adjusted by taking the local average brightness difference of the target area where the pixel position is located in the image after brightness difference smoothing as the brightness adjustment amount.

8. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the image brightness matching method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the image brightness matching method described in any one of claims 1 to 7 is implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the image brightness matching method described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Image splicing method based on brightness adaptive registration

    CN105046643A

  • Brightness equalization method and device for vehicle-mounted surround view system

    CN107330872A