CN115278104A - Image brightness adjusting method and device, electronic equipment and storage medium - Google Patents

Image brightness adjusting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115278104A
CN115278104A CN202210780694.XA CN202210780694A CN115278104A CN 115278104 A CN115278104 A CN 115278104A CN 202210780694 A CN202210780694 A CN 202210780694A CN 115278104 A CN115278104 A CN 115278104A
Authority
CN
China
Prior art keywords
brightness
image
maximum connected
connected domain
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210780694.XA
Other languages
Chinese (zh)
Other versions
CN115278104B (en
Inventor
潘润发
陈焕
陈天钧
张东
沈广月
卢二利
况璐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202210780694.XA priority Critical patent/CN115278104B/en
Publication of CN115278104A publication Critical patent/CN115278104A/en
Application granted granted Critical
Publication of CN115278104B publication Critical patent/CN115278104B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/77Circuits for processing the brightness signal and the chrominance signal relative to each other, e.g. adjusting the phase of the brightness signal relative to the colour signal, correcting differential gain or differential phase

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the application provides an image brightness adjusting method and device, electronic equipment and a storage medium, which are used for adjusting the relation of picture contrast and avoiding overstretching the picture contrast. The method comprises the following steps: acquiring an image in a visual field range of a camera and drawing a corresponding brightness histogram of the image; acquiring a first pixel brightness change curve by using a histogram equalization method based on the brightness histogram; wherein, the slope in the pixel brightness change curve is used for indicating the contrast enhancement amplitude between the current brightness and the adjacent brightness; adjusting the slope in the first pixel brightness change curve according to the mapping relation between the brightness and the preset slope threshold value to obtain a second pixel brightness change curve; the mapping relation is determined according to a plurality of maximum connected domains of the image, one maximum connected domain corresponds to one sub-image, and the sub-image is obtained by dividing the image according to a preset division rule; and adjusting the brightness of each pixel in the image based on the second pixel brightness change curve.

Description

Image brightness adjusting method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image brightness adjustment method and apparatus, an electronic device, and a storage medium.
Background
In the field of image processing, histogram equalization is a commonly used method for enhancing the contrast of an image, and adjusts the contrast of the image by observing basic information such as histogram distribution of the image and a change in the contrast of the image gray scale range.
However, although histogram equalization improves image contrast, has low computational complexity, and is suitable for performing rough real-time image enhancement, adjusting contrast by using the histogram equalization method may cause some areas of a picture to become darker or brighter, and lose part of detail information, and histogram equalization is prone to excessively stretch picture contrast, so that the equalized image is distorted.
Disclosure of Invention
The embodiment of the application provides an image brightness adjusting method and device, electronic equipment and a storage medium, which are used for adjusting the relation of picture contrast and avoiding overstretching the picture contrast.
In a first aspect, an image brightness adjustment method is provided, including:
acquiring an image in a camera view range and drawing a brightness histogram corresponding to the image;
acquiring a first pixel brightness change curve by utilizing a histogram equalization method based on the brightness histogram; wherein, the slope in the pixel brightness change curve is used for indicating the contrast enhancement amplitude between the current brightness and the adjacent brightness;
adjusting the slope in the first pixel brightness change curve according to the mapping relation between the brightness and a preset slope threshold value to obtain a second pixel brightness change curve; the mapping relation is determined according to a plurality of maximum connected domains of the image, one maximum connected domain corresponds to one sub-image, and the sub-image is obtained by dividing the image according to a preset dividing rule;
and adjusting the brightness of each pixel in the image based on the second pixel brightness change curve.
Optionally, the method further includes:
dividing the image into a plurality of sub-images according to a preset brightness interval;
determining a maximum connected domain corresponding to each sub-image, and calculating the size of the maximum connected domain corresponding to the maximum connected domain;
drawing a relation curve of the maximum connected domain size and the brightness according to the maximum connected domain size and a preset brightness interval, and determining a first mapping relation between the maximum connected domain size and the brightness;
and determining the mapping relation between the brightness and the preset slope threshold value based on the second mapping relation between the preset maximum connected domain size and the preset slope threshold value and the first mapping relation.
Optionally, the calculating a maximum connected component size corresponding to the maximum connected component includes:
acquiring the number of pixels contained in a target maximum connected domain;
and squaring the pixel number, and dividing the pixel number by the image size corresponding to the image to obtain the maximum connected domain size corresponding to the target maximum connected domain.
Optionally, the determining the maximum connected component corresponding to each sub-image includes:
carrying out binarization processing on each sub-image to obtain a plurality of binarization images;
and determining the maximum connected domain corresponding to each sub-image based on the plurality of binarized images.
Optionally, the adjusting the slope of the first pixel brightness change curve according to the mapping relationship between the brightness and the preset slope threshold includes:
determining a target slope of a target brightness on the first pixel brightness change curve;
determining whether the target slope is greater than a preset slope threshold corresponding to the target brightness;
and if the target slope is greater than a preset slope threshold corresponding to the target brightness, adjusting the target slope to the preset slope threshold corresponding to the target brightness.
In a second aspect, an image brightness adjusting apparatus is provided, including:
the acquisition module is used for acquiring an image in the field of view of the camera and drawing a brightness histogram corresponding to the image through the processing module;
the acquisition module is further used for acquiring a first pixel brightness change curve by utilizing a histogram equalization method based on the brightness histogram; wherein, the slope in the pixel brightness change curve is used for indicating the contrast enhancement amplitude between the current brightness and the adjacent brightness;
the processing module is further configured to adjust a slope in the first pixel brightness change curve according to a mapping relationship between brightness and a preset slope threshold, so as to obtain a second pixel brightness change curve; the mapping relation is determined according to a plurality of maximum connected domains of the image, one maximum connected domain corresponds to one sub-image, and the sub-image is obtained by dividing the image according to a preset dividing rule;
the processing module is further configured to adjust the brightness of each pixel in the image based on the second pixel brightness variation curve.
Optionally, the processing module is further configured to:
dividing the image into a plurality of sub-images according to a preset brightness interval;
determining a maximum connected domain corresponding to each sub-image, and calculating the size of the maximum connected domain corresponding to the maximum connected domain;
drawing a relation curve of the maximum connected domain size and the brightness according to the maximum connected domain size and a preset brightness interval, and determining a first mapping relation between the maximum connected domain size and the brightness;
and determining the mapping relation between the brightness and the preset slope threshold value based on the second mapping relation between the preset maximum connected domain size and the preset slope threshold value and the first mapping relation.
Optionally, the obtaining module is specifically configured to:
acquiring the number of pixels contained in the maximum connected domain of a target;
the processing module is specifically configured to:
and squaring the pixel number, and dividing the pixel number by the image size corresponding to the image to obtain the maximum connected domain size corresponding to the target maximum connected domain.
Optionally, the processing module is specifically configured to:
carrying out binarization processing on each sub-image to obtain a plurality of binarization images;
and determining the maximum connected domain corresponding to each sub-image based on the plurality of binarized images.
Optionally, the processing module is specifically configured to:
determining a target slope of the target brightness on the first pixel brightness change curve;
determining whether the target slope is greater than a preset slope threshold corresponding to the target brightness;
and if the target slope is greater than a preset slope threshold corresponding to the target brightness, adjusting the target slope to the preset slope threshold corresponding to the target brightness.
In a third aspect, an electronic device is provided, which includes:
a memory for storing program instructions;
a processor for calling the program instructions stored in said memory and for executing the steps comprised in any of the methods of the first aspect in accordance with the obtained program instructions.
In a fourth aspect, there is provided a computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform the steps comprising the method of any one of the first aspects.
In a fifth aspect, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform the image brightness adjustment method described in the various possible implementations described above.
In the embodiment of the application, an image in a field of view of a camera is acquired, a luminance histogram corresponding to the image is drawn, a first pixel luminance change curve is acquired by using a histogram equalization method based on the luminance histogram, wherein a slope in the pixel luminance change curve is used for indicating a contrast enhancement amplitude between current luminance and adjacent luminance, the slope in the first pixel luminance change curve is adjusted according to a mapping relation between the luminance and a preset slope threshold value, so as to obtain a second pixel luminance change curve, wherein the mapping relation is determined according to a plurality of maximum connected domains of the image, one maximum connected domain corresponds to one sub-image, the sub-image is obtained by dividing the image in the field of view of the camera according to a preset dividing rule, and the luminance of each pixel in the image is adjusted based on the second pixel luminance change curve.
That is to say, the present application limits the preset slope threshold in the first pixel luminance change curve obtained by using the histogram equalization method through the mapping relationship between the luminance and the preset slope threshold, for example, when the slope corresponding to a certain luminance on the first pixel luminance change curve is greater than the preset slope threshold corresponding to the luminance, the slope corresponding to the luminance on the first pixel luminance change curve is adjusted to the preset slope threshold corresponding to the luminance to obtain the second pixel luminance change curve, and the picture luminance is adjusted based on the limited pixel luminance change curve (the second pixel luminance change curve), so that the image contrast after adjustment can be in a relatively proper range, thereby avoiding the picture from being excessively stretched in contrast. In addition, the method and the device consider that the stretching contrast ratio can lead to the reduction of the picture quality of the large-area same-color scenery, so that the contrast enhancement amplitude of the corresponding brightness can be weakened by identifying the large-area same-color scenery through the maximum connected domain of each sub-image, and the contrast stretching amplitude of the large-area same-color scenery is effectively reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application.
Fig. 1 is a flowchart of an image brightness adjusting method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of another image brightness adjustment method according to an embodiment of the present disclosure;
fig. 3 is a block diagram of an image brightness adjusting apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a computer device in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the technical solutions in the embodiments of the present application will be described below clearly and completely with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. In the present application, the embodiments and features of the embodiments may be arbitrarily combined with each other without conflict. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
The terms "first" and "second" in the description and claims of the present application and the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the term "comprises" and any variations thereof, which are intended to cover non-exclusive protection. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The "plurality" in the present application may mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
In addition, the term "and/or" herein is only one kind of association relationship describing the association object, and means that there may be three kinds of relationships, for example, a and/or B, and may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in this document generally indicates that the preceding and following related objects are in an "or" relationship, unless otherwise specified.
For ease of understanding, the technical background of the embodiments of the present invention is described below.
As described above, adjusting the picture contrast using histogram equalization may cause some areas of the picture to become darker or brighter, and some detail information may be lost, and the histogram equalization may easily excessively stretch the picture contrast, so that the equalized image may be distorted. At present, there is a method of uniformly blocking a preprocessed image and drawing a pixel distribution histogram of each small image, optimizing the histogram according to a preset threshold value and setting a dynamically adjustable gray level range of an enhanced image to obtain a pixel transformation function of a corresponding sub-image block, and using a bilinear interpolation method to avoid a discontinuity phenomenon between sub-image blocks after pixel transformation. And partitioning the preprocessed image according to a calculation method to obtain four corresponding calculation regions, and processing pixel points in batches in different regions in a matrix calculation mode to obtain an image with enhanced contrast. When local enhancement processing is carried out on partial sub-images with low contrast by adopting a preset threshold value, the condition of picture over-stretching is not considered, and a stable and uniform contrast enhancement degree cannot be found; and, for large-area same-color scenes, contrast stretching still occurs, which may result in picture quality degradation.
In view of this, an embodiment of the present application provides an image brightness adjustment method, which includes acquiring an image in a field of view of a camera, drawing a brightness histogram corresponding to the image, acquiring a first pixel brightness change curve based on the brightness histogram by using a histogram equalization method, adjusting a slope in the first pixel brightness change curve according to a mapping relationship between brightness and a preset slope threshold, to obtain a second pixel brightness change curve, and adjusting brightness of each pixel in the image based on the second pixel brightness change curve, so that contrast of the adjusted image is in a relatively proper range, thereby avoiding a situation that a picture is over-stretched in contrast. The mapping relation between the brightness and the preset slope threshold is determined according to a plurality of maximum connected domains of the image, one maximum connected domain corresponds to one sub-image, and the sub-images are obtained by dividing the image in the field of view of the camera according to the preset division rule, so that large-area same-color scenes can be identified through the maximum connected domain of each sub-image, the contrast enhancement amplitude of the corresponding brightness is reduced, and the contrast stretching of the large-area same-color scenes is effectively reduced.
After introducing the design concept of the embodiment of the present application, some simple descriptions are provided below for application scenarios to which the technical solution of the embodiment of the present application can be applied, and it should be noted that the application scenarios described below are only used for describing the embodiment of the present application and are not limited. In specific implementation, the technical scheme provided by the embodiment of the application can be flexibly applied according to actual needs.
In the embodiment of the application, the provided image brightness adjusting method and image brightness adjusting device can be applied to a video monitoring system, and the video monitoring system comprises an image acquisition system and a data analysis control system. The image brightness adjusting method provided by the application can be executed by an image acquisition system in a video monitoring system, or the image acquisition system sends the image to a data analysis control system, and the data analysis control system executes the image brightness adjusting method. The image acquisition system provides a shooting device, which is an electronic device such as a camera, a mobile phone with a camera function or a tablet, a monitoring device, and the like, and is used for acquiring an image of a monitoring area.
The following describes an image brightness adjustment method provided in an embodiment of the present application with reference to the drawings of the specification. Referring to fig. 1, a flow of an image brightness adjustment method in the embodiment of the present application is described as follows:
step 101: acquiring an image in a visual field range of a camera and drawing a corresponding brightness histogram of the image;
in the embodiment of the application, an image in a visual field range of a camera is acquired, the number of pixels of each brightness value in the image is counted and displayed in a histogram form, and a brightness histogram yHist corresponding to the image is obtained.
Step 102: acquiring a first pixel brightness change curve by utilizing a histogram equalization method based on the brightness histogram;
in the embodiment of the present application, a first pixel brightness change curve heY (y) is obtained based on yHist by using a histogram equalization method, where the pixel brightness change curve heY (y) is used to indicate the change of the brightness of each pixel, that is, the abscissa in the pixel brightness change curve is the brightness value of the pixel before the histogram equalization method, the ordinate is the brightness value after the histogram equalization method, for example, the current brightness is 67, and the brightness after the histogram equalization is 34, the ordinate value corresponding to the abscissa 67 of the pixel brightness change curve is 34, the slope in the pixel brightness change curve heY (y) is used to indicate the contrast enhancement amplitude between the current brightness and the adjacent brightness, and the greater the slope is, the greater the contrast enhancement amplitude is, for example, the adjacent brightness of the current brightness (for example, 68), the contrast is 1, the brightness of the pixel after the histogram equalization is 38, and the contrast is 4, the contrast enhancement amplitude between the current brightness and the adjacent brightness is 4/1=4 (i.e., the slope is 4).
Step 103: adjusting the slope in the first pixel brightness change curve according to the mapping relation between the brightness and the preset slope threshold value to obtain a second pixel brightness change curve;
as described above, adjusting the picture contrast using histogram equalization may cause some areas of the picture to become darker or brighter, and some detail information may be lost, and the histogram equalization may easily excessively stretch the picture contrast, so that the equalized image may be distorted. Therefore, in the embodiment of the present application, the slope in the first pixel brightness change curve is defined through the mapping relationship between the brightness and the preset slope threshold, that is, the slope in the first pixel brightness change curve is adjusted through the mapping relationship between the brightness and the preset slope threshold, so as to obtain the second pixel brightness change curve.
Specifically, a target slope of the target brightness in the first pixel brightness change curve is obtained, wherein the target slope of the target brightness in the first pixel brightness change curve can be represented by a tangent corresponding to an included angle between a tangent of the first pixel brightness change curve at the target brightness and an abscissa (brightness); determining whether the target slope is greater than a preset slope threshold corresponding to the target brightness, and if the target slope is less than or equal to the preset slope threshold corresponding to the target brightness, not adjusting the target slope corresponding to the target brightness; if the target slope is greater than the preset slope threshold corresponding to the target brightness, the target slope is adjusted to the preset slope threshold corresponding to the target brightness, and a second pixel brightness change curve is obtained. For example, the preset slope threshold corresponding to 20% of the brightness is 4, and the target slope of the point with 20% of the brightness on the first pixel brightness change curve is 3.8, at this time, if the target slope is smaller than the preset slope threshold corresponding to the current brightness, the slope corresponding to the current brightness in the first pixel brightness change curve is not adjusted; for another example, the preset slope threshold corresponding to 10% of the brightness is 2, and the target slope of the point with 10% of the brightness on the first pixel brightness change curve is 2.5, at this time, the target slope is greater than the preset slope threshold corresponding to the current brightness, and then the slope on the first pixel brightness change curve is adjusted to 2.
The mapping relationship between the brightness and the preset slope threshold is determined according to a plurality of maximum connected domains of the image, one maximum connected domain corresponds to one sub-image, the plurality of sub-images are obtained by dividing the image according to a preset division rule, and the determination process of the mapping relationship between the brightness and the preset slope threshold is described in detail below.
Dividing an image into a plurality of sub-images according to a preset brightness interval, for example, extracting pixels with the pixel brightness of 0-10% as a sub-image 1 (img 1), extracting pixels with the pixel brightness of 11% -20% as a sub-image 2 (img 2), \8230;, extracting pixels with the pixel brightness of 91% -100% as a sub-image 10 (img 10), then determining a maximum connected domain corresponding to each sub-image, calculating the maximum connected domain size (maxCr 1, maxCr2, \8230;, maxCr 10) corresponding to each maximum connected domain, wherein maxCr1 is the maximum connected domain size corresponding to img1, maxCr2 is the maximum connected domain size corresponding to img2, and maxCr10 is the maximum connected domain size corresponding to img10, drawing a maximum connected domain size-brightness relation curve according to the maximum connected domain size and the preset brightness interval, for example, maxCr1, maxCr2, \8230:, maxCr10 is used as a vertical coordinate, 5%,15%, \8230;, 95% brightness is used as a horizontal coordinate, a relation curve (for example, a first relation curve) between the maximum connected domain size maxCr and the brightness y is drawn, the relation curve is used as a first mapping relation between the maximum connected domain size maxCr and the brightness y, and a mapping relation between the brightness and a preset slope threshold value is determined based on a second mapping relation and the first mapping relation, wherein the second mapping relation is a mapping relation between the preset maximum connected domain size and the preset slope threshold value, the preset slope threshold value generally decreases as the maximum connected domain size increases, specific numerical values can be adjusted according to effects, and the adjusted data is used as configuration written in a camera device.
As a possible implementation manner, the second mapping relationship is a relationship curve between the maximum connected domain size and the preset slope threshold, in this case, the maximum connected domain size may be used as an abscissa, the preset slope threshold may be used as an ordinate, a relationship curve (for example, the second relationship curve) between the maximum connected domain size and the preset slope threshold is drawn, and the first relationship curve is interpolated by the second relationship curve to form a relationship curve between the brightness and the preset slope threshold.
The maximum connected component size corresponding to each maximum connected component can be calculated according to the number of pixels contained in the maximum connected component of each sub-image, for example, the number of pixels contained in the target maximum connected component is obtained, the number of pixels is squared (for example, squared, cubed, \8230;) is squared, and the normalization is performed by dividing the number of pixels by the image size, so as to obtain the maximum connected component size corresponding to the target maximum connected component.
As a possible implementation manner, since the maximum connected component generally refers to the maximum connected component connected in the binary image, in this embodiment of the present application, before determining the maximum connected component corresponding to each sub-image, each sub-image may be further subjected to binarization processing to obtain a plurality of binarized images, and then the maximum connected component corresponding to each sub-image is determined based on the plurality of binarized images.
In a specific implementation process, the larger the maximum connected component size is, the more likely that a large-area same-color scene exists under corresponding brightness, and at this time, the smaller the contrast stretching of the brightness should be, so that the contrast enhancement amplitude of corresponding brightness can be reduced by identifying the large-area same-color scene through the maximum connected component of each sub-image, and thus the contrast stretching amplitude of the large-area same-color scene can be effectively reduced.
Step 104: and adjusting the brightness of each pixel in the image based on the second pixel brightness change curve.
In a specific implementation process, the preset slope threshold corresponding to each brightness in the first pixel brightness change curve is limited through the mapping relation between the brightness and the preset slope threshold, so that the adjusted image contrast is in a relatively proper range, the contrast stretching amplitude of large-area same-color scenes can be obviously weakened, and the image quality is high.
In order to better understand the technical solution of the present application, the predistortion extension model and the method for implementing predistortion provided by the present application will be explained with reference to specific embodiments.
Examples
Referring to fig. 2, an image in a field of view of a camera is obtained as an original image, a luminance histogram corresponding to the original image is drawn, a pixel transformation curve (a first pixel luminance variation curve) heY (y) is obtained by using a histogram equalization method based on the luminance histogram, the original image is divided according to a preset luminance interval to generate a plurality of segmented luminance images (sub-images img1 to img 10), a maximum connected domain size corresponding to each sub-image is obtained, a relation curve maxCr (y) (i.e., a first mapping relation) of luminance and the maximum connected domain size is drawn based on the maximum connected domain size and the corresponding luminance interval, then the maxCr (y) is interpolated according to a relation curve kMaxCurve (y) (i.e., a second mapping relation) between the preset maximum connected domain size and a preset slope threshold, a relation curve yilimcurve (y) between luminance and the preset slope threshold is obtained, a slope of heY (y) is limited by the yilimcurve (y) to obtain a second pixel luminance variation curve, and a slope of each luminance in the image is adjusted based on the second pixel luminance variation curve.
Based on the same inventive concept, the embodiment of the present application provides an image brightness adjusting apparatus, which can implement the corresponding function of the image brightness adjusting method. The image brightness adjusting device can be a hardware structure, a software module, or a hardware structure and a software module. The image brightness adjusting device can be realized by a chip system, and the chip system can be formed by a chip and can also comprise the chip and other discrete devices. Referring to fig. 3, the image brightness adjusting apparatus includes an obtaining module 301 and a processing module 302. Wherein:
an acquisition module 301, configured to acquire an image within a field of view of a camera and draw a luminance histogram corresponding to the image through a processing module 302;
the obtaining module 301 is further configured to obtain a first pixel luminance change curve by using a histogram equalization method based on the luminance histogram; wherein, the slope in the pixel brightness change curve is used for indicating the contrast enhancement amplitude between the current brightness and the adjacent brightness;
the processing module 302 is further configured to adjust a slope in the first pixel brightness change curve according to a mapping relationship between brightness and a preset slope threshold, so as to obtain a second pixel brightness change curve; the mapping relation is determined according to a plurality of maximum connected domains of the image, one maximum connected domain corresponds to one sub-image, and the sub-image is obtained by dividing the image according to a preset dividing rule;
the processing module 302 is further configured to adjust the brightness of each pixel in the image based on the second pixel brightness variation curve.
Optionally, the processing module 302 is further configured to:
dividing the image into a plurality of sub-images according to a preset brightness interval;
determining the maximum connected domain corresponding to each sub-image, and calculating the size of the maximum connected domain corresponding to the maximum connected domain;
drawing a relation curve of the maximum connected domain size and the brightness according to the maximum connected domain size and a preset brightness interval, and determining a first mapping relation between the maximum connected domain size and the brightness;
and determining the mapping relation between the brightness and the preset slope threshold value based on the second mapping relation between the preset maximum connected domain size and the preset slope threshold value and the first mapping relation.
Optionally, the obtaining module 301 is specifically configured to:
acquiring the number of pixels contained in a target maximum connected domain;
the processing module 302 is specifically configured to:
and squaring the pixel number, and dividing the pixel number by the image size corresponding to the image to obtain the maximum connected domain size corresponding to the target maximum connected domain.
Optionally, the processing module 302 is specifically configured to:
carrying out binarization processing on each sub-image to obtain a plurality of binarization images;
and determining the maximum connected domain corresponding to each sub-image based on the plurality of binarized images.
Optionally, the processing module 302 is specifically configured to:
determining a target slope of a target brightness on the first pixel brightness change curve;
determining whether the target slope is greater than a preset slope threshold corresponding to the target brightness;
and if the target slope is greater than a preset slope threshold corresponding to the target brightness, adjusting the target slope to the preset slope threshold corresponding to the target brightness.
All relevant contents of the steps related to the embodiment of the image brightness adjusting method can be introduced to the functional description of the functional module corresponding to the image brightness adjusting device in the embodiment of the present application, and are not repeated herein.
The division of the modules in the embodiments of the present application is schematic, and only one logical function division is provided, and in actual implementation, there may be another division manner, and in addition, each functional module in each embodiment of the present application may be integrated in one processor, may also exist alone physically, or may also be integrated in one module by two or more modules. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Based on the same inventive concept, the embodiment of the application provides electronic equipment. Referring to fig. 4, the electronic device includes at least one processor 401 and a memory 402 connected to the at least one processor, a specific connection medium between the processor 401 and the memory 402 is not limited in this embodiment, in fig. 4, the processor 401 and the memory 402 are connected by a bus 400 as an example, the bus 400 is represented by a thick line in fig. 4, and a connection manner between other components is only schematically illustrated and is not limited. The bus 400 may be divided into an address bus, a data bus, a control bus, etc., and is shown in fig. 4 with only one thick line for ease of illustration, but does not represent only one bus or type of bus.
In the embodiment of the present application, the memory 402 stores instructions executable by the at least one processor 401, and the at least one processor 401 may execute the steps included in the foregoing image brightness adjusting method by executing the instructions stored in the memory 402.
The processor 401 is a control center of the electronic device, and may connect various portions of the whole electronic device by using various interfaces and lines, and perform various functions and process data of the electronic device by operating or executing instructions stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring on the electronic device. Alternatively, the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, an application program, and the like, and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401. In some embodiments, processor 401 and memory 402 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 401 may be a general-purpose processor, such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like, that may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the image brightness adjusting method disclosed in the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
Memory 402, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 402 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 402 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 402 in the embodiments of the present application may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
By programming the processor 401, the code corresponding to the image brightness adjustment method described in the foregoing embodiment may be solidified in the chip, so that the chip can execute the steps of the image brightness adjustment method when running, and how to program the processor 401 is a technique known by those skilled in the art, and is not described herein again.
Based on the same inventive concept, embodiments of the present application further provide a computer-readable storage medium, which stores computer instructions, and when the computer instructions are executed on a computer, the computer is caused to execute the steps of the image brightness adjusting method as described above.
In some possible embodiments, the aspects of the image brightness adjustment method provided in this application may also be implemented in the form of a program product, which includes program code for causing a detection device to perform the steps in the image brightness adjustment method according to various exemplary embodiments of this application described above in this specification, when the program product is run on an electronic device.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. An image brightness adjustment method, comprising:
acquiring an image in a camera view range and drawing a brightness histogram corresponding to the image;
acquiring a first pixel brightness change curve by utilizing a histogram equalization method based on the brightness histogram; wherein, the slope in the pixel brightness change curve is used for indicating the contrast enhancement amplitude between the current brightness and the adjacent brightness;
adjusting the slope in the first pixel brightness change curve according to the mapping relation between the brightness and a preset slope threshold value to obtain a second pixel brightness change curve; the mapping relation is determined according to a plurality of maximum connected domains of the image, one maximum connected domain corresponds to one sub-image, and the sub-image is obtained by dividing the image according to a preset dividing rule;
and adjusting the brightness of each pixel in the image based on the second pixel brightness change curve.
2. The method of claim 1, further comprising:
dividing the image into a plurality of sub-images according to a preset brightness interval;
determining the maximum connected domain corresponding to each sub-image, and calculating the size of the maximum connected domain corresponding to the maximum connected domain;
drawing a relation curve of the maximum connected domain size and the brightness according to the maximum connected domain size and a preset brightness interval, and determining a first mapping relation between the maximum connected domain size and the brightness;
and determining the mapping relation between the brightness and the preset slope threshold value based on a second mapping relation between the preset maximum connected domain size and the preset slope threshold value and the first mapping relation.
3. The method of claim 2, wherein the calculating the maximum connected component size corresponding to the maximum connected component comprises:
acquiring the number of pixels contained in a target maximum connected domain;
and squaring the pixel number, and dividing the pixel number by the image size corresponding to the image to obtain the maximum connected domain size corresponding to the target maximum connected domain.
4. The method of claim 2, wherein determining the maximum connected component for each sub-image comprises:
carrying out binarization processing on each sub-image to obtain a plurality of binarization images;
and determining the maximum connected domain corresponding to each sub-image based on the plurality of binarized images.
5. The method as claimed in claim 1, wherein said adjusting the slope of the first pixel brightness variation curve according to the mapping relationship between the brightness and the preset slope threshold comprises:
determining a target slope of a target brightness on the first pixel brightness change curve;
determining whether the target slope is greater than a preset slope threshold corresponding to the target brightness;
and if the target slope is greater than a preset slope threshold corresponding to the target brightness, adjusting the target slope to the preset slope threshold corresponding to the target brightness.
6. An image brightness adjustment device, comprising:
the acquisition module is used for acquiring an image in the field of view of the camera and drawing a brightness histogram corresponding to the image through the processing module;
the acquisition module is further used for acquiring a first pixel brightness change curve by utilizing a histogram equalization method based on the brightness histogram; wherein, the slope in the pixel brightness change curve is used for indicating the contrast enhancement amplitude between the current brightness and the adjacent brightness;
the processing module is further configured to adjust a slope in the first pixel brightness change curve according to a mapping relationship between brightness and a preset slope threshold, so as to obtain a second pixel brightness change curve; the mapping relation is determined according to a plurality of maximum connected domains of the image, one maximum connected domain corresponds to one sub-image, and the sub-image is obtained by dividing the image according to a preset dividing rule;
the processing module is further configured to adjust the brightness of each pixel in the image based on the second pixel brightness variation curve.
7. The apparatus of claim 6, wherein the processing module is further configured to:
dividing the image into a plurality of sub-images according to a preset brightness interval;
determining the maximum connected domain corresponding to each sub-image, and calculating the size of the maximum connected domain corresponding to the maximum connected domain;
drawing a relation curve of the maximum connected domain size and the brightness according to the maximum connected domain size and a preset brightness interval, and determining a first mapping relation between the maximum connected domain size and the brightness;
and determining the mapping relation between the brightness and the preset slope threshold value based on a second mapping relation between the preset maximum connected domain size and the preset slope threshold value and the first mapping relation.
8. The apparatus of claim 7, wherein the obtaining module is specifically configured to:
acquiring the number of pixels contained in a target maximum connected domain;
the processing module is specifically configured to:
and squaring the pixel number, and dividing the pixel number by the image size corresponding to the image to obtain the maximum connected domain size corresponding to the target maximum connected domain.
9. An electronic device, comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory and for executing the steps comprised by the method of any one of claims 1 to 5 in accordance with the obtained program instructions.
10. A computer-readable storage medium, characterized in that it stores a computer program comprising program instructions which, when executed by a computer, cause the computer to carry out the method according to any one of claims 1-5.
CN202210780694.XA 2022-07-04 2022-07-04 Image brightness adjustment method and device, electronic equipment and storage medium Active CN115278104B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210780694.XA CN115278104B (en) 2022-07-04 2022-07-04 Image brightness adjustment method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210780694.XA CN115278104B (en) 2022-07-04 2022-07-04 Image brightness adjustment method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115278104A true CN115278104A (en) 2022-11-01
CN115278104B CN115278104B (en) 2024-02-09

Family

ID=83763953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210780694.XA Active CN115278104B (en) 2022-07-04 2022-07-04 Image brightness adjustment method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115278104B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116246265A (en) * 2023-05-12 2023-06-09 威海凯思信息科技有限公司 Property management method and device based on image processing

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7227893B1 (en) * 2002-08-22 2007-06-05 Xlabs Holdings, Llc Application-specific object-based segmentation and recognition system
US20100283872A1 (en) * 2009-05-08 2010-11-11 Qualcomm Incorporated Systems, methods, and apparatus for generation of reinforcement pattern and systems, methods, and apparatus for artifact evaluation
WO2017162069A1 (en) * 2016-03-25 2017-09-28 阿里巴巴集团控股有限公司 Image text identification method and apparatus
CN107452355A (en) * 2017-08-09 2017-12-08 青岛海信电器股份有限公司 The method of adjustment and device of a kind of dynamic contrast
US20180047141A1 (en) * 2016-08-11 2018-02-15 Intel Corporation Brightness control for spatially adaptive tone mapping of high dynamic range (hdr) images
CN107730477A (en) * 2017-10-13 2018-02-23 西安科技大学 Substation equipment infrared intelligent monitoring system and monitoring image feature extracting method
CN108460744A (en) * 2018-03-21 2018-08-28 武汉理工大学 A kind of enhancing of cement cutting pavement image noise reduction and FRACTURE CHARACTERISTICS extracting method
CN110809146A (en) * 2019-11-01 2020-02-18 厦门美图之家科技有限公司 Image contrast adjusting method and device, terminal equipment and storage medium
CN111402147A (en) * 2020-02-26 2020-07-10 浙江大华技术股份有限公司 Video image processing method, video image processing device, computer equipment and storage medium
CN111862228A (en) * 2020-06-04 2020-10-30 福瑞泰克智能系统有限公司 Occlusion detection method, system, computer device and readable storage medium
CN112489055A (en) * 2020-11-30 2021-03-12 中南大学 Satellite video dynamic vehicle target extraction method fusing brightness-time sequence characteristics
WO2021189222A1 (en) * 2020-03-24 2021-09-30 华为技术有限公司 Image enhancement processing method and device
CN113689396A (en) * 2021-08-20 2021-11-23 深圳先进技术研究院 Cell fluorescence image thresholding method, system, terminal and storage medium
CN113747008A (en) * 2021-08-18 2021-12-03 浙江大华技术股份有限公司 Camera and light supplementing method
CN113822897A (en) * 2021-11-22 2021-12-21 武汉楚精灵医疗科技有限公司 Blood vessel segmentation method, terminal and computer-readable storage medium
CN113888429A (en) * 2021-09-29 2022-01-04 Oppo广东移动通信有限公司 Image brightening method and device and electronic equipment
CN114612310A (en) * 2020-12-04 2022-06-10 深圳Tcl新技术有限公司 Image enhancement processing method and computer equipment

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7227893B1 (en) * 2002-08-22 2007-06-05 Xlabs Holdings, Llc Application-specific object-based segmentation and recognition system
US20100283872A1 (en) * 2009-05-08 2010-11-11 Qualcomm Incorporated Systems, methods, and apparatus for generation of reinforcement pattern and systems, methods, and apparatus for artifact evaluation
WO2017162069A1 (en) * 2016-03-25 2017-09-28 阿里巴巴集团控股有限公司 Image text identification method and apparatus
US20180047141A1 (en) * 2016-08-11 2018-02-15 Intel Corporation Brightness control for spatially adaptive tone mapping of high dynamic range (hdr) images
CN107452355A (en) * 2017-08-09 2017-12-08 青岛海信电器股份有限公司 The method of adjustment and device of a kind of dynamic contrast
CN107730477A (en) * 2017-10-13 2018-02-23 西安科技大学 Substation equipment infrared intelligent monitoring system and monitoring image feature extracting method
CN108460744A (en) * 2018-03-21 2018-08-28 武汉理工大学 A kind of enhancing of cement cutting pavement image noise reduction and FRACTURE CHARACTERISTICS extracting method
CN110809146A (en) * 2019-11-01 2020-02-18 厦门美图之家科技有限公司 Image contrast adjusting method and device, terminal equipment and storage medium
CN111402147A (en) * 2020-02-26 2020-07-10 浙江大华技术股份有限公司 Video image processing method, video image processing device, computer equipment and storage medium
WO2021189222A1 (en) * 2020-03-24 2021-09-30 华为技术有限公司 Image enhancement processing method and device
CN111862228A (en) * 2020-06-04 2020-10-30 福瑞泰克智能系统有限公司 Occlusion detection method, system, computer device and readable storage medium
CN112489055A (en) * 2020-11-30 2021-03-12 中南大学 Satellite video dynamic vehicle target extraction method fusing brightness-time sequence characteristics
CN114612310A (en) * 2020-12-04 2022-06-10 深圳Tcl新技术有限公司 Image enhancement processing method and computer equipment
CN113747008A (en) * 2021-08-18 2021-12-03 浙江大华技术股份有限公司 Camera and light supplementing method
CN113689396A (en) * 2021-08-20 2021-11-23 深圳先进技术研究院 Cell fluorescence image thresholding method, system, terminal and storage medium
CN113888429A (en) * 2021-09-29 2022-01-04 Oppo广东移动通信有限公司 Image brightening method and device and electronic equipment
CN113822897A (en) * 2021-11-22 2021-12-21 武汉楚精灵医疗科技有限公司 Blood vessel segmentation method, terminal and computer-readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘翔: "复杂环境下车牌定位算法仿真研究", 信息技术, no. 02 *
宋巧君: "基于双边滤波和Black-hat变换的OSTU裂缝分割算法", 《信息技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116246265A (en) * 2023-05-12 2023-06-09 威海凯思信息科技有限公司 Property management method and device based on image processing
CN116246265B (en) * 2023-05-12 2023-08-08 威海凯思信息科技有限公司 Property management method and device based on image processing

Also Published As

Publication number Publication date
CN115278104B (en) 2024-02-09

Similar Documents

Publication Publication Date Title
CN109146816B (en) Image filtering method and device, electronic equipment and storage medium
CN103973988A (en) Scene recognition method and device
CN113126937B (en) Display terminal adjusting method and display terminal
CN114095667B (en) Automatic exposure method, device, electronic equipment and storage medium
CN111601048B (en) Image processing method and device
CN110400271B (en) Stripe non-uniformity correction method and device, electronic equipment and storage medium
CN111383206B (en) Image processing method and device, electronic equipment and storage medium
CN110223244B (en) Image processing method and device, electronic equipment and storage medium
CN113596573B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111914668A (en) Pedestrian re-identification method, device and system based on image enhancement technology
CN111127342A (en) Image processing method and device, storage medium and terminal equipment
CN111368587A (en) Scene detection method and device, terminal equipment and computer readable storage medium
CN110969046A (en) Face recognition method, face recognition device and computer-readable storage medium
CN109344824A (en) A kind of line of text method for detecting area, device, medium and electronic equipment
CN115278104B (en) Image brightness adjustment method and device, electronic equipment and storage medium
CN111028276A (en) Image alignment method and device, storage medium and electronic equipment
CN113747008B (en) Camera and light supplementing method
CN111563517A (en) Image processing method, image processing device, electronic equipment and storage medium
CN113436068B (en) Image splicing method and device, electronic equipment and storage medium
CN111654747B (en) Bullet screen display method and device
CN111539975B (en) Method, device, equipment and storage medium for detecting moving object
CN106971386B (en) Method and device for judging image integrity and page loading degree and client equipment
CN111507923A (en) Method, device, equipment and medium for processing noise of video image
CN109558878B (en) Image recognition method and device
CN114596210A (en) Noise estimation method, device, terminal equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant