CN117041739A - Automatic image exposure method, system, equipment and storage medium - Google Patents

Automatic image exposure method, system, equipment and storage medium Download PDF

Info

Publication number
CN117041739A
CN117041739A CN202311019663.3A CN202311019663A CN117041739A CN 117041739 A CN117041739 A CN 117041739A CN 202311019663 A CN202311019663 A CN 202311019663A CN 117041739 A CN117041739 A CN 117041739A
Authority
CN
China
Prior art keywords
image
value
brightness
exposure
entropy
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.)
Pending
Application number
CN202311019663.3A
Other languages
Chinese (zh)
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.)
Beijing Haomo Technology Co ltd
Original Assignee
Beijing Haomo 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 Beijing Haomo Technology Co ltd filed Critical Beijing Haomo Technology Co ltd
Priority to CN202311019663.3A priority Critical patent/CN117041739A/en
Publication of CN117041739A publication Critical patent/CN117041739A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/76Circuitry for compensating brightness variation in the scene by influencing the image signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention discloses an automatic image exposure method, an automatic image exposure system, automatic image exposure equipment and a storage medium, wherein after an original image is acquired, brightness calculation is carried out on the original image to obtain a brightness value; judging whether the brightness value is in a preset range or not; if the brightness value is not in the preset range, the current exposure value is adjusted, and the brightness value is recalculated; if the brightness value is within the preset range, calculating the image entropy of the original image; judging whether the image entropy is smaller than a preset threshold value or not; if the image entropy is smaller than the preset threshold value, the current exposure value is adjusted, and the brightness value is recalculated; and if the image entropy is greater than or equal to a preset threshold value, the current exposure value is the optimal exposure value. The embodiment of the invention can improve the image exposure adaptability under complex environments such as low illumination, strong light and the like, and avoid the problem of flickering of images, thereby ensuring the enrichment and completeness of image information and providing high-quality image data for a back-end analysis system and a display system.

Description

Automatic image exposure method, system, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of machine vision, in particular to an automatic image exposure method, an automatic image exposure system, automatic image exposure equipment and a storage medium.
Background
The exposure refers to the amount of light entering the camera and impinging on the digital sensor, and is an indicator of how dark or bright a photograph is. If too much light is directed onto the sensor, this may cause overexposure resulting in an image that is too bright, and if insufficient light is directed onto the sensor, this may result in underexposure resulting in an image that is too dark.
With the continuous development of machine vision, the quality requirements on images are gradually improved. The quality of the image is directly determined by the advantages and disadvantages of the automatic exposure algorithm, but the current automatic exposure algorithm cannot adapt to the requirements of complex environments such as low illumination, strong light and the like, and serious problems of image flickering can occur.
Disclosure of Invention
Therefore, the embodiment of the invention provides an automatic image exposure method, an automatic image exposure system, automatic image exposure equipment and a storage medium, so that the problems that the prior art cannot adapt to the requirements of complex environments such as low illumination, strong light and the like and image flickering is avoided are solved.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
according to a first aspect of an embodiment of the present invention, there is provided an image auto-exposure method, including:
collecting an original image;
performing brightness calculation on the original image to obtain a brightness value;
judging whether the brightness value is in a preset range or not;
if the brightness value is not in the preset range, the current exposure value is adjusted, and the brightness value is recalculated;
if the brightness value is within the preset range, calculating the image entropy of the original image;
judging whether the image entropy is smaller than a preset threshold value or not;
if the image entropy is smaller than a preset threshold value, the current exposure value is adjusted, and the brightness value is recalculated;
and if the image entropy is greater than or equal to a preset threshold value, the current exposure value is the optimal exposure value.
Further, performing luminance calculation on the original image to obtain a luminance value, including:
judging whether the original image is a color image or not;
if the original image is a color image, converting the color image into a black-and-white image and calculating brightness by utilizing the black-and-white image;
if the original image is a black-and-white image, the brightness calculation is directly performed.
Further, the luminance calculation formula is:
wherein L is a brightness value, m and n are the pixel row number and the pixel column number of the image, and a (i, j) is the gray value of the pixel in the ith row and the jth column.
Further, converting the color image into a black-and-white image and performing brightness calculation using the black-and-white image, further comprising:
the formula for converting the color image into the black-and-white image is as follows:
Y=0.2989×R+0.5870×G+0.1140×B
where Y is a gray value and R, G, B is a pixel value of three components of the color image, respectively.
Further, calculating an image entropy of the original image, including:
the calculation formula of the image entropy is as follows:
wherein H (x) is image entropy, and P (a) i ) For the probability of a certain pixel occurrence, a i The number of pixels is the pixel value i, and n is the total number of pixels.
According to a second aspect of an embodiment of the present invention, there is provided an image automatic exposure system including:
the acquisition module is used for acquiring an original image;
the brightness calculation module is used for calculating the brightness of the original image to obtain a brightness value;
the brightness judging module is used for judging whether the brightness value is in a preset range or not; if the brightness value is not in the preset range, the current exposure value is adjusted, and the brightness value is recalculated; if the brightness value is within the preset range, calculating the image entropy of the original image;
the image entropy judging module is used for judging whether the image entropy is smaller than a preset threshold value or not; if the image entropy is smaller than a preset threshold value, the current exposure value is adjusted, and the brightness value is recalculated; and if the image entropy is greater than or equal to a preset threshold value, the current exposure value is the optimal exposure value.
According to a third aspect of an embodiment of the present invention, there is provided an image automatic exposure apparatus including: a processor and a memory;
the memory is used for storing one or more program instructions;
the processor is configured to execute one or more program instructions for performing the steps of an automatic image exposure method as described in any one of the preceding claims.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of an image auto-exposure method as defined in any one of the above.
The embodiment of the invention has the following advantages:
after an original image is acquired, brightness calculation is carried out on the original image to obtain a brightness value; judging whether the brightness value is in a preset range or not; if the brightness value is not in the preset range, the current exposure value is adjusted, and the brightness value is recalculated; if the brightness value is within the preset range, calculating the image entropy of the original image; judging whether the image entropy is smaller than a preset threshold value or not; if the image entropy is smaller than a preset threshold value, the current exposure value is adjusted, and the brightness value is recalculated; and if the image entropy is greater than or equal to a preset threshold value, the current exposure value is the optimal exposure value. The embodiment of the invention can improve the image exposure adaptability under complex environments such as low illumination, strong light and the like, and avoid the problem of flickering of images, thereby ensuring the enrichment and completeness of image information and providing high-quality image data for a back-end analysis system and a display system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It will be apparent to those skilled in the art from this disclosure that the drawings described below are merely exemplary and that other embodiments may be derived from the drawings provided without undue effort.
The structures, proportions, sizes, etc. shown in the present specification are shown only for the purposes of illustration and description, and are not intended to limit the scope of the invention, which is defined by the claims, so that any structural modifications, changes in proportions, or adjustments of sizes, which do not affect the efficacy or the achievement of the present invention, should fall within the ambit of the technical disclosure.
FIG. 1 is a schematic diagram of a logic structure of an automatic image exposure system according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of an automatic image exposure method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of outdoor half-day and half-field exposure in an automatic image exposure method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of outdoor non-half-day and half-field exposure in an automatic image exposure method according to an embodiment of the present invention;
fig. 5 is an indoor exposure schematic diagram in an automatic image exposure method according to an embodiment of the present invention.
Detailed Description
Other advantages and advantages of the present invention will become apparent to those skilled in the art from the following detailed description, which, by way of illustration, is to be read in connection with certain specific embodiments, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
With the continuous development of machine vision, the quality requirements on images are gradually improved. The quality of the image is directly determined by the advantages and disadvantages of the automatic exposure algorithm, but the current automatic exposure algorithm cannot adapt to the requirements of complex environments such as low illumination, strong light and the like, and serious problems of image flickering can occur.
In order to solve the problem that the prior art cannot adapt to the requirements of complex environments such as low illumination, strong light and the like, the problem of image flickering is avoided.
Referring to fig. 1, an embodiment of the present invention discloses an image automatic exposure system, which includes: an acquisition module 100; a brightness calculation module 200; a brightness judgment module 300; the image entropy determination module 400.
Corresponding to the above-disclosed automatic image exposure system, the embodiment of the invention also discloses an automatic image exposure method. An automatic image exposure method disclosed in the embodiment of the present invention is described in detail below in conjunction with an automatic image exposure system described above.
The acquisition module 100 acquires an original image; the brightness calculation module 200 performs brightness calculation on the original image to obtain a brightness value; the brightness judging module 300 judges whether the brightness value is within a preset range; if the brightness value is not in the preset range, the current exposure value is adjusted, and the brightness value is recalculated; if the brightness value is within the preset range, calculating the image entropy of the original image; the image entropy judging module 400 judges whether the image entropy is smaller than a preset threshold value; if the image entropy is smaller than a preset threshold value, the current exposure value is adjusted, and the brightness value is recalculated; and if the image entropy is greater than or equal to a preset threshold value, the current exposure value is the optimal exposure value.
For the brightness of the image, when the pixel value of the image is 8 bits, that is, when the gray value of the image is about 120, the image is an image which accords with human visual perception, therefore, the preset range is 80-160, and when the brightness of the image is within the range, the brightness of the image can be considered to meet the requirement.
Further, performing luminance calculation on the original image to obtain a luminance value, including: judging whether the original image is a color image or not; if the original image is a color image, converting the color image into a black-and-white image and calculating brightness by utilizing the black-and-white image; if the original image is a black-and-white image, the brightness calculation is directly performed.
Further, the luminance calculation formula is:
wherein L is a brightness value, m and n are the pixel row number and the pixel column number of the image, and a (i, j) is the gray value of the pixel in the ith row and the jth column.
Further, converting the color image into a black-and-white image and performing brightness calculation using the black-and-white image, further comprising:
the formula for converting the color image into the black-and-white image is as follows:
Y=0.2989×R+0.5870×G+0.1140×B
where Y is a gray value and R, G, B is a pixel value of three components of the color image, respectively.
Further, calculating an image entropy of the original image, including:
the calculation formula of the image entropy is as follows:
wherein H (x) is image entropy, and P (a) i ) For the occurrence probability of each pixel, a i The number of pixels is the pixel value i, and n is the total number of pixels.
Wherein, the preset threshold value of the image entropy is 6.9, and the preset threshold value can be modified according to different parameters.
The image entropy is an estimated value of the busyness degree of the image, and the larger the value of the image entropy is, the better the image quality is, the more uniform the gray level distribution is, and the larger the information amount of the image is. When the image is a pure color image, only one gray value is contained, the entropy is minimum, and the information quantity of the image is 0; when the image contains n gray values, i.e. the gray values of each pixel of the image are different, the entropy is the largest and the information content is the largest.
In addition, the embodiment of the invention also provides an image automatic exposure device, which comprises: a processor and a memory; the memory is used for storing one or more program instructions; the processor is configured to execute one or more program instructions for performing the steps of an automatic image exposure method as described in any one of the preceding claims.
In addition, an embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the computer program is executed by a processor to implement the steps of an image automatic exposure method according to any one of the above.
In the embodiment of the invention, the processor may be an integrated circuit chip with signal processing capability. The processor may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP for short), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC for short), a field programmable gate array (FieldProgrammable GateArray, FPGA for short), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The processor reads the information in the storage medium and, in combination with its hardware, performs the steps of the above method.
The storage medium may be memory, for example, may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory.
The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable ROM (Electrically EPROM, EEPROM), or a flash Memory.
The volatile memory may be a random access memory (Random Access Memory, RAM for short) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (Double Data RateSDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (directracram, DRRAM).
The storage media described in embodiments of the present invention are intended to comprise, without being limited to, these and any other suitable types of memory.
Those skilled in the art will appreciate that in one or more of the examples described above, the functions described in the present invention may be implemented in a combination of hardware and software. When the software is applied, the corresponding functions may be stored in a computer-readable medium or transmitted as one or more instructions or code on the computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
While the invention has been described in detail in the foregoing general description and specific examples, it will be apparent to those skilled in the art that modifications and improvements can be made thereto. Accordingly, such modifications or improvements may be made without departing from the spirit of the invention and are intended to be within the scope of the invention as claimed.

Claims (8)

1. An automatic exposure method for an image, the method comprising:
collecting an original image;
performing brightness calculation on the original image to obtain a brightness value;
judging whether the brightness value is in a preset range or not;
if the brightness value is not in the preset range, the current exposure value is adjusted, and the brightness value is recalculated;
if the brightness value is within the preset range, calculating the image entropy of the original image;
judging whether the image entropy is smaller than a preset threshold value or not;
if the image entropy is smaller than a preset threshold value, the current exposure value is adjusted, and the brightness value is recalculated;
and if the image entropy is greater than or equal to a preset threshold value, the current exposure value is the optimal exposure value.
2. An image auto-exposure method according to claim 1, wherein performing brightness calculation on the original image to obtain a brightness value comprises:
judging whether the original image is a color image or not;
if the original image is a color image, converting the color image into a black-and-white image and calculating brightness by utilizing the black-and-white image;
if the original image is a black-and-white image, the brightness calculation is directly performed.
3. The method of automatic exposure of an image according to claim 2, wherein the brightness calculation formula is:
wherein L is a brightness value, m and n are the pixel row number and the pixel column number of the image, and a (i, j) is the gray value of the pixel in the ith row and the jth column.
4. An image auto-exposure method according to claim 2, wherein converting the color image into a black-and-white image and performing brightness calculation using the black-and-white image, further comprising:
the formula for converting the color image into the black-and-white image is as follows:
Y=0.2989×R+0.5870×G+0.1140×B
where Y is a gray value and R, G, B is a pixel value of three components of the color image, respectively.
5. The method of automatic exposure of an image according to claim 1, wherein calculating the image entropy of the original image comprises:
the calculation formula of the image entropy is as follows:
wherein H (x) is image entropy, and P (a) i ) For the probability of occurrence of a certain pixel value, a i The number of pixels is the pixel value i, and n is the total number of pixels.
6. An automatic image exposure system, the system comprising:
the acquisition module is used for acquiring an original image;
the brightness calculation module is used for calculating the brightness of the original image to obtain a brightness value;
the brightness judging module is used for judging whether the brightness value is in a preset range or not; if the brightness value is not in the preset range, the current exposure value is adjusted, and the brightness value is recalculated; if the brightness value is within the preset range, calculating the image entropy of the original image;
the image entropy judging module is used for judging whether the image entropy is smaller than a preset threshold value or not; if the image entropy is smaller than a preset threshold value, the current exposure value is adjusted, and the brightness value is recalculated; and if the image entropy is greater than or equal to a preset threshold value, the current exposure value is the optimal exposure value.
7. An image automatic exposure apparatus, characterized in that the apparatus comprises: a processor and a memory;
the memory is used for storing one or more program instructions;
the processor is configured to execute one or more program instructions for performing the steps of an image auto-exposure method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of an image auto-exposure method according to any one of claims 1 to 5.
CN202311019663.3A 2023-08-14 2023-08-14 Automatic image exposure method, system, equipment and storage medium Pending CN117041739A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311019663.3A CN117041739A (en) 2023-08-14 2023-08-14 Automatic image exposure method, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311019663.3A CN117041739A (en) 2023-08-14 2023-08-14 Automatic image exposure method, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117041739A true CN117041739A (en) 2023-11-10

Family

ID=88601868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311019663.3A Pending CN117041739A (en) 2023-08-14 2023-08-14 Automatic image exposure method, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117041739A (en)

Similar Documents

Publication Publication Date Title
CN110033418B (en) Image processing method, image processing device, storage medium and electronic equipment
CN109801240B (en) Image enhancement method and image enhancement device
US11431915B2 (en) Image acquisition method, electronic device, and non-transitory computer readable storage medium
EP2854389A1 (en) Scene recognition method and apparatus
CN105407296B (en) Real-time video enhancement method and device
CN112819702B (en) Image enhancement method, image enhancement device, electronic equipment and computer readable storage medium
CN112565636B (en) Image processing method, device, equipment and storage medium
CN105578068A (en) High-dynamic-range image generation method, device and mobile terminal
CN108989699B (en) Image synthesis method, image synthesis device, imaging apparatus, electronic apparatus, and computer-readable storage medium
CN110809146A (en) Image contrast adjusting method and device, terminal equipment and storage medium
CN110881108B (en) Image processing method and image processing apparatus
WO2019056549A1 (en) Image enhancement method, and image processing device
CN107800971B (en) Auto-exposure control processing method, device and the equipment of pan-shot
CN107682611B (en) Focusing method and device, computer readable storage medium and electronic equipment
CN112598609B (en) Dynamic image processing method and device
CN114467298B (en) Image signal conversion processing method and device and terminal equipment
CN111539975B (en) Method, device, equipment and storage medium for detecting moving object
CN117041739A (en) Automatic image exposure method, system, equipment and storage medium
CN113808045B (en) Image brightness adjusting method and device
CN114283100A (en) High dynamic range image synthesis and tone mapping method and electronic equipment
CN113891081A (en) Video processing method, device and equipment
CN114374793A (en) Exposure control method, device, equipment and storage medium
CN113971645A (en) Image wide dynamic enhancement method and device
CN112950509A (en) Image processing method and device and electronic equipment
CN103841384A (en) Image-quality optimization method and device

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