Infrared image brightness evaluation, exposure control method, device and medium
Patent Information
- Application Number
- CN202110038492.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-12
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2041-01-12
AI Technical Summary
[0002]常规的对红外图像亮度评价、曝光控制方法是基于整图的亮度评价和反馈控制,对于局部高对比度的红外图像,由于其局部对比度强,且高亮区域小,若采用常规的亮度评价、曝光控制方法,容易造成局部过曝,导致图像质量差不利于后续图像算法处理
[0023]上述红外图像亮度评价、曝光控制方法、设备及介质,获取红外图像的局部高亮区域,即实施例中所述矩形区域,基于矩形区域对红外图像进行亮度评价、曝光控制。针对局部高对比度的红外图像场景提供了一种亮度评价、曝光控制的解决方案,有利于后续的图像算法处理。
Smart Images

Figure CN114765666B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of infrared image processing and exposure control technology, and in particular to an infrared image brightness evaluation, exposure control method, device and medium. Background Technology
[0002] Conventional methods for evaluating the brightness and controlling the exposure of infrared images are based on the brightness evaluation and feedback control of the entire image. For infrared images with high local contrast, due to the strong local contrast and small bright areas, using conventional methods for brightness evaluation and exposure control can easily lead to local overexposure, resulting in poor image quality and hindering subsequent image processing algorithms. Summary of the Invention
[0003] This invention provides a method, device, and medium for evaluating the brightness and controlling the exposure of infrared images, offering a technical solution for evaluating the brightness and controlling the exposure of locally high-contrast infrared images.
[0004] An infrared image brightness evaluation method includes the following steps:
[0005] Acquire an infrared image as the image to be evaluated;
[0006] Within a rectangular area of N*M pixels at the center of the image to be evaluated, count the number of pixels whose pixel values are less than or equal to the first pixel threshold and greater than or equal to the second pixel threshold.
[0007] The ratio of the number of pixels within the above threshold to the total number of pixels in the rectangular area is compared with a preset ratio threshold to determine whether the rectangular area is a highlight or a shadow.
[0008] Calculate the average brightness value of each pixel within the rectangular area under either highlight or low light conditions, and use this as the metering value.
[0009] An exposure control method, including the above-mentioned infrared image brightness evaluation method, further includes the following exposure control steps:
[0010] Based on the measured photometric value and the preset target photometric value, the photometric deviation value is obtained;
[0011] Determine the exposure adjustment step size based on the measured light deviation value;
[0012] Based on whether the rectangular area contains highlights or shadows, highlights and shadows are divided into two modes for the exposure control step;
[0013] The metering deviation value for each mode is divided into several levels according to its numerical value, and each level corresponds to a set of exposure parameters according to the exposure adjustment step size.
[0014] Exposure parameters are set according to the gear level, and exposure control commands are output to achieve exposure control.
[0015] An infrared image brightness evaluation device, comprising:
[0016] The image acquisition module is used to acquire an infrared image as the image to be evaluated.
[0017] The rectangular region brightness interval statistics module is used to count the number of pixels whose pixel values are less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold within a rectangular region of the center of the image to be evaluated (N*M pixels).
[0018] The rectangular region highlight / low light determination module is used to compare the ratio of the number of pixels within the above threshold to the total number of pixels in the rectangular region with a preset ratio threshold to determine whether the rectangular region is a highlight or a low light.
[0019] The light metering evaluation module is used to calculate the average brightness value of each pixel within a rectangular area under bright or low light conditions, and use this as the light metering value.
[0020] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor, when executing the computer-readable instructions, implements the steps of the infrared image brightness evaluation or exposure control method described above.
[0021] A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the above-described infrared image brightness evaluation and exposure control method.
[0022] One or more readable storage media storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to implement the steps of the infrared image brightness evaluation and exposure control method described above.
[0023] The aforementioned infrared image brightness evaluation and exposure control method, device, and medium acquire locally bright areas of the infrared image, namely the rectangular areas described in the embodiments, and perform brightness evaluation and exposure control on the infrared image based on these rectangular areas. This provides a solution for brightness evaluation and exposure control in locally high-contrast infrared image scenes, which is beneficial for subsequent image algorithm processing. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is an image to be evaluated according to an infrared image brightness evaluation method in an embodiment of the present invention;
[0026] Figure 2 This is a region segmentation image of an infrared image brightness evaluation method according to an embodiment of the present invention;
[0027] Figure 3 This is a binary image of a portion of an image to be evaluated, representing an infrared image brightness evaluation method according to an embodiment of the present invention.
[0028] Figure 4 This is a flowchart of an infrared image brightness evaluation method according to an embodiment of the present invention;
[0029] Figure 5 This is a flowchart of an infrared image brightness evaluation method according to an embodiment of the present invention;
[0030] Figure 6 This is another flowchart of an infrared image brightness evaluation method according to an embodiment of the present invention;
[0031] Figure 7 This is another flowchart of an infrared image brightness evaluation method according to an embodiment of the present invention;
[0032] Figure 8 This is a flowchart of an infrared image exposure control method according to an embodiment of the present invention;
[0033] Figure 9 This is a schematic diagram of an infrared image brightness evaluation device according to an embodiment of the present invention;
[0034] Figure 10 This is a schematic diagram of a computer device in an embodiment of the present invention. Detailed Implementation
[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0036] In one embodiment of the present invention, as Figure 4 As shown, an infrared image brightness evaluation method is provided, which is then applied to... Figure 1 The following steps are used as an example, taking the infrared image shown as an example:
[0037] Step S1: Acquire an infrared image as the image to be evaluated.
[0038] Specifically, in order to obtain the brightness evaluation of an infrared image, the image can first be acquired through an infrared camera and used as an image to be evaluated, so as to provide a basis for subsequent operations related to the evaluation of infrared image brightness.
[0039] Step S2: Within the rectangular area of the center of the image to be evaluated (N*M pixels), count the number of pixels whose pixel values are less than or equal to the first pixel threshold and greater than or equal to the second pixel threshold.
[0040] Specifically, a rectangular region of N*M pixels is obtained from the center of the image to be evaluated. For ease of calculation, this rectangular region is typically a square, which can be a 200x200 pixel square. In other embodiments, it can be a region with other pixel counts; this is not limited here. The rectangular region is then segmented using a first pixel threshold to obtain a first binary image. In this first binary image, pixels with brightness values less than or equal to the first pixel threshold have a grayscale value of 0. The pixels with grayscale values of 0 in the first binary image and those in the rectangular region with brightness values greater than the second pixel threshold are then identified and their counts are recorded.
[0041] Alternatively, a rectangular region of N*M pixels can be obtained from the center of the image to be evaluated; the rectangular region can be segmented using a second pixel threshold to obtain a second binary image; the grayscale value of each pixel in the rectangular region whose brightness value is greater than or equal to the second pixel threshold is 255; the pixels in the second binary image whose grayscale value is 255 and whose pixel value in the rectangular region is less than or equal to the first pixel threshold can be obtained, and their number can be counted.
[0042] For ease of calculation, the rectangular area of N*M pixels is generally taken as a square. This rectangular area can be a square area of 200x200 pixels. In other embodiments, it can also be a region of other numbers of pixels. There is no limitation here.
[0043] Step S3 for determining highlights and low light in a rectangular area: Compare the ratio of the number of pixels within the above threshold to the total number of pixels in the rectangular area with a preset ratio threshold to determine whether the rectangular area is a highlight or a low light.
[0044] Specifically, the ratio of the number of pixels within the threshold range to the total number of pixels in the rectangular region is calculated; the ratio of the number of pixels within the threshold range to the total number of pixels in the rectangular region is compared with a preset ratio threshold; when the ratio is greater than the preset ratio threshold, the rectangular region is determined to be a highlight; when the ratio is less than or equal to the preset ratio threshold, the rectangular region is determined to be a low light.
[0045] Metering evaluation step S4: Calculate the average brightness value of each pixel in the rectangular area under highlights or low light, and use this as the metering value.
[0046] Specifically, when the rectangular area is in high light, a ring-shaped area of a certain set pixel size is extended from the outer edge to the inner edge of the image to be evaluated; the average brightness value of each pixel in the ring-shaped area is calculated and used as the metering value; when the rectangular area is in low light, the average brightness value of each pixel in the rectangular area whose brightness value is greater than the first pixel threshold is calculated and used as the metering value.
[0047] The annular region is defined as a region extending inward from the outer periphery of the image to be evaluated by X pixels. For ease of calculation, a annular region extending inward from the outer periphery of the image to be evaluated by 100 pixels is typically used. In other embodiments, a region extending inward from the outer periphery of the image to be evaluated by other numbers of pixels may also be used, which is not limited here.
[0048] In embodiments of the present invention, such as Figure 5 As shown, the rectangular region brightness interval statistics step S2 involves counting the number of pixels with pixel values less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold within a rectangular region of N*M pixels at the center of the image to be evaluated. This specifically includes the following steps:
[0049] S21: Take a rectangular region of N*M pixels from the center of the image to be evaluated.
[0050] Specifically, a rectangular region of N*M pixels is selected from the center of the image to be evaluated, such as... Figure 2 The area shown as 201 is the rectangular area. Here, a pixel is the smallest unit in an image represented by a numerical sequence; it exists as a small square of a single color. In this embodiment of the invention, the rectangular area is a square, specifically a region of 200*200 pixels.
[0051] S22: The rectangular region is segmented using a first pixel threshold to obtain a binary image.
[0052] Specifically, the first pixel threshold refers to a preset pixel value used for threshold segmentation, with a value range of 0 to 255. A pixel value is a value assigned by the computer when the original image is digitized; it represents the average brightness information of a small square in the original image, or the average reflectance (transmission) density information of that small square. Image segmentation refers to separating different regions with specific meanings in an image. These regions are non-overlapping, and each region satisfies specific region consistency requirements. Here, the threshold refers to a set pixel value, ranging from 0 to 255. Threshold segmentation is a region-based image segmentation technique that divides image pixels into several categories. It utilizes the difference in brightness between the target and the background in the image, and by setting a threshold, divides pixels into several categories, thereby achieving separation of the target and the background. A binary image refers to setting the brightness value of pixels in an image to 0 or 255, thus presenting the entire image with a clear visual effect of only black and white. Binary images occupy less space and are commonly used in image processing techniques.
[0053] Alternatively, the rectangular region can be segmented using a second pixel threshold to obtain a second binary image; the grayscale value of each pixel in the rectangular region whose brightness value is greater than or equal to the second pixel threshold is 255.
[0054] S23: Count the number of pixels in the rectangular area corresponding to the binary image whose brightness value is less than or equal to the first pixel threshold and greater than or equal to the second pixel threshold.
[0055] Specifically, the second pixel threshold, like the first pixel threshold, refers to a set pixel value used to obtain a range of pixels. The number of pixels within the corresponding rectangular area of the binary image whose brightness value is less than or equal to the first pixel threshold and greater than or equal to the second pixel threshold is counted from the obtained range. For example... Figure 3 The image shown is a binary image corresponding to the portion of the image to be evaluated where the pixel value is greater than the first threshold and less than the second threshold.
[0056] Alternatively, the rectangular region can be segmented using a second pixel threshold to obtain a second binary image; the number of pixels in the second binary image with a grayscale value of 255 whose brightness value is less than or equal to the first pixel threshold in the rectangular region can be counted.
[0057] In embodiments of the present invention, such as Figure 6 As shown, step S3 for determining the highlight / low light in the rectangular area involves comparing the ratio of the number of pixels within the aforementioned threshold to the total number of pixels in the rectangular area with a preset ratio threshold to determine whether the rectangular area is a highlight or a low light. This specifically includes the following steps:
[0058] S31: Calculate the ratio of the number of pixels with pixel values less than or equal to the first pixel threshold and greater than or equal to the second pixel threshold to the total number of pixels in the rectangular area.
[0059] Specifically, the ratio of the number of pixels whose pixel values are less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold to the total number of pixels in the rectangular region is obtained.
[0060] Alternatively, the rectangular region can be segmented using a second pixel threshold to obtain a second binary image; the grayscale value of each pixel in the rectangular region whose brightness value is greater than or equal to the second pixel threshold is 255; the number of pixels in the second binary image with a grayscale value of 255 whose brightness value is less than or equal to the first pixel threshold in the rectangular region can be counted; the ratio of the number of pixels whose pixel value is less than or equal to the first pixel threshold and greater than or equal to the second pixel threshold to the total number of pixels in the rectangular region can be obtained.
[0061] S32: Compare the ratio of the number of pixels in the above threshold range to the total number of pixels in the rectangular area with a preset ratio threshold to determine whether the rectangular area is a highlight or a shadow.
[0062] Specifically, the preset ratio threshold refers to a pre-set ratio threshold, which serves as a judgment standard. It is used to compare the ratio of the number of pixels within the threshold range to the total number of pixels in the rectangular area, and to divide highlights and low light based on the comparison result. The preset ratio threshold ranges from 0 to 1 and is not a fixed value.
[0063] S33: When the ratio is greater than the preset ratio threshold, it is determined that the rectangular area is a highlight.
[0064] Specifically, the ratio of the number of pixels whose pixel values are less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold to the total number of pixels in the rectangular area is compared with a preset ratio threshold. When the ratio is greater than the preset ratio threshold, it is determined that the rectangular area contains highlights.
[0065] S34: When the ratio is less than or equal to a preset ratio threshold, it is determined that the rectangular area is a low-light region.
[0066] Specifically, the ratio of the number of pixels whose pixel values are less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold to the total number of pixels in the rectangular area is compared with a preset ratio threshold. When the ratio is less than or equal to the preset ratio threshold, the rectangular area is determined to be low-light.
[0067] Optionally, different exposure modes are available for highlights and low light.
[0068] In embodiments of the present invention, such as Figure 7 As shown, based on Figure 6 Step S32, the metering evaluation step S4, involves calculating the average brightness value of the pixels within the rectangular area under highlights or low light, and using this as the metering value. This specifically includes the following steps:
[0069] S41: Calculate the photometric value of the image to be evaluated based on the determined highlights or low light.
[0070] Specifically, such as Figure 6 As shown, step S32 involves comparing the ratio of the number of pixels within the aforementioned threshold range to the total number of pixels in the rectangular region with a preset threshold ratio to determine whether the rectangular region is a highlight or a shadow. Once the rectangular region has been determined to be a highlight or a shadow, different processing is applied based on this result, and the corresponding metering value is calculated.
[0071] S42: When the rectangular area is a highlight, expand a ring-shaped area of a certain set pixel size from the outer periphery inward from the center of the image to be evaluated, calculate the average brightness value of each pixel in the ring-shaped area, and use it as the photometric value.
[0072] Specifically, when the rectangular area contains highlights, a ring-shaped area of a predetermined pixel size is extended inward from the outer edge of the image to be evaluated, such as... Figure 2 For the region shown in Figure 202, the average brightness value of each pixel within the annular region is calculated and used as the metering value. The average brightness value includes weighted average brightness values with different weights. The annular region is defined as the area extending X pixels inward from the outer edge of the image to be evaluated.
[0073] S43: When the rectangular area is in low light, calculate the average brightness value of each pixel in the rectangular area whose pixel value is greater than the first pixel threshold, and use it as the photometric value.
[0074] Specifically, when the rectangular area is under low light, the average brightness value of all pixels in the rectangular area whose pixel value is greater than the first pixel threshold is calculated and used as the photometric value. The average brightness value includes weighted average brightness values with different weights.
[0075] In one embodiment of the present invention, as Figure 8 As shown, an exposure control method is provided. This exposure control method is based on the aforementioned infrared image brightness evaluation method and further includes the following exposure control steps:
[0076] S81: Calculate a photometric deviation value based on the photometric value and the preset target photometric value.
[0077] Specifically, the preset target metering value refers to the target metering value for automatic exposure adjustment of the brightness of local bright areas, i.e., ensuring that areas with strong supplemental lighting are not overexposed and areas with weak supplemental lighting are not underexposed. The metering deviation value refers to the difference between the metering value obtained in the infrared image brightness evaluation method under bright or low light conditions and the target metering value.
[0078] S82: Determine the exposure adjustment step size based on the metering deviation value.
[0079] Specifically, based on the measured value and the preset target measured value, a measured deviation value is calculated, which is the difference between the measured value obtained in the infrared image brightness evaluation method under high or low light conditions and the target measured value; based on the measured deviation value, the exposure adjustment step size is determined; and based on the exposure adjustment step size, the exposure time or digital gain is adjusted.
[0080] S83: Based on whether the rectangular area contains highlights or shadows, the highlights and shadows are divided into two modes in the exposure control step.
[0081] Specifically, based on the infrared image brightness evaluation method, it is determined whether the rectangular area is a highlight or a low light. In the exposure control step, the highlight and low light in the rectangular area are divided into two modes.
[0082] S84: Divide the metering deviation value into several levels according to its numerical value, and according to the exposure adjustment step size, each level corresponds to a set of exposure parameters.
[0083] Specifically, based on the measured value and the preset target measured value, a metering deviation value is calculated, which is the difference between the measured value obtained in the infrared image brightness evaluation method under high or low light conditions and the target measured value. Based on the metering deviation value, the exposure adjustment step size is determined. According to whether the rectangular area is high or low light, high light and low light are divided into two modes in the exposure control step. Each mode is further divided into several levels according to the difference between the measured value and the target measured value. Each level corresponds to a set of exposure parameters based on the exposure adjustment step size. The exposure parameters refer to the exposure time and digital gain, and the corresponding exposure time and digital gain are set according to the metering difference value.
[0084] S85: Sets exposure parameters according to the gear position, outputs exposure control commands, and realizes exposure control.
[0085] Specifically, the exposure parameters refer to the exposure time and digital gain. The corresponding exposure time and digital gain are set based on the metering difference value. For example, if the ratio of the number of pixels with values less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold within the rectangular area of the image to be evaluated to the total number of pixels in the rectangular area is greater than a preset ratio threshold, then the rectangular area is considered a highlight, which corresponds to the highlight mode in the exposure control step. A ring-shaped area of a set pixel size is extended inwards from the outer edge of the image to be evaluated. The average brightness value of each pixel within this ring-shaped area is calculated and used as the metering value. The difference between this metering value and the target metering value corresponding to the highlight mode in the exposure control step is divided into several levels. By adjusting these levels—that is, adjusting the different exposure parameters corresponding to each exposure level—the local overexposure area is adjusted, preventing overexposure in bright, dark areas, thus achieving exposure control.
[0086] An infrared image brightness evaluation device, such as Figure 9 As shown, it specifically includes the following modules:
[0087] The image acquisition module 91 is used to acquire an infrared image as the image to be evaluated.
[0088] The rectangular region brightness interval statistics module 92 is used to count the number of pixels whose pixel values are less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold within a rectangular region of the center N*M pixel point of the image to be evaluated.
[0089] The rectangular region highlight and low light judgment module 93 is used to compare the ratio of the number of pixels within the above threshold to the total number of pixels in the rectangular region with a certain preset ratio threshold to determine whether the rectangular region is a highlight or a low light.
[0090] The light metering evaluation module 94 is used to calculate the average brightness value of each pixel within a rectangular area under high or low light conditions, and use this as the light metering value.
[0091] Preferably, the rectangular region brightness interval statistics module 92, that is, within the rectangular region of the center N*M pixel point of the image to be evaluated, counts the number of pixels whose pixel values are less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold, includes: a region division unit, a region preprocessing unit, and a data statistics unit.
[0092] The region division unit is used to select a rectangular region of N*M pixels from the center of the image to be evaluated.
[0093] Region preprocessing unit: used to perform threshold segmentation on the rectangular region using a first pixel threshold to obtain a binary image.
[0094] The data statistics unit is used to count the number of pixels with brightness values less than or equal to the first pixel threshold and greater than or equal to the second pixel threshold within the rectangular area corresponding to the binary image.
[0095] Preferably, the rectangular area highlight / low light judgment module 93 compares the ratio of the number of pixels within the above threshold to the total number of pixels in the rectangular area with a preset ratio threshold to determine whether the rectangular area is highlight or low light, and includes: a data acquisition unit, a first judgment unit, and a second judgment unit.
[0096] The data acquisition unit is used to obtain the ratio of the number of pixels whose pixel values are less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold to the total number of pixels in the rectangular area, and to determine the size of the ratio relative to a preset ratio threshold based on the ratio.
[0097] The first judgment unit determines that the rectangular area contains highlights when the ratio is greater than the preset ratio threshold.
[0098] The second judgment unit is used to compare the ratio with a preset ratio threshold. When the ratio is less than the preset ratio threshold, it is determined that the rectangular area is low light.
[0099] Preferably, the photometric evaluation module 94, which calculates the average brightness value of each pixel within a rectangular area under high or low light conditions and uses it as the photometric value, includes: a first judgment unit and a second judgment unit.
[0100] The first judgment unit is used to calculate the average brightness value of each pixel in the annular region when the rectangular region is a highlight, by expanding an annular region of a certain set pixel size from the outside to the inside of the image to be evaluated, and using this as the photometric value.
[0101] The second judgment unit is used to calculate the average brightness value of each pixel in the rectangular area whose brightness value is greater than the first pixel threshold when the rectangular area is in low light, and use this as the photometric value.
[0102] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a readable storage medium and internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The network interface is used to communicate with an external server via a network connection. When the computer-readable instructions are executed by the processor, they implement the steps of the infrared image brightness evaluation and exposure control methods described in the above embodiments. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.
[0103] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, it implements the steps of the infrared image brightness evaluation and exposure control methods described in the above embodiments, for example... Figure 4 Steps S1-S4 and shown Figure 8 The steps shown, or Figures 5 to 8 The steps shown are omitted here to avoid repetition. Alternatively, the processor executes the computer program to implement the functions of each module / unit in this embodiment of the user interface automated testing device, for example... Figure 9 The following modules are shown: image acquisition module 91, rectangular area brightness interval statistics module 92, rectangular area high and low light judgment module 93, and photometric value evaluation module 94. To avoid repetition, they will not be described in detail here.
[0104] In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media. The readable storage media stores computer-readable instructions, which, when executed by one or more processors, implement the steps of the infrared image brightness evaluation and exposure control methods described in the above embodiments, for example... Figure 4 Steps S1-S4 and shown Figure 8 The steps shown, or Figures 5 to 8 The steps shown are omitted here to avoid repetition. Alternatively, the processor executes the computer program to implement the functions of each module / unit in this embodiment of the user interface automated testing device, for example... Figure 9 The following modules are shown: image acquisition module 91, rectangular area brightness interval statistics module 92, rectangular area high and low light judgment module 93, and photometric value evaluation module 94. To avoid repetition, they will not be described in detail here.
[0105] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0107] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
Claims
1. A method for evaluating the brightness of infrared images, characterized in that, include: Acquire an infrared image as the image to be evaluated; Within a rectangular area of N*M pixels at the center of the image to be evaluated, count the number of pixels whose pixel values are less than or equal to the first pixel threshold and greater than or equal to the second pixel threshold. The ratio of the number of pixels within the above threshold to the total number of pixels in the rectangular area is compared with a preset ratio threshold to determine whether the rectangular area is a highlight or a shadow, including: when the ratio is greater than the preset ratio threshold, the rectangular area is determined to be a highlight. When the ratio is less than or equal to a preset ratio threshold, the rectangular area is determined to be under-light. When the rectangular area is in high light, a ring-shaped area of a set pixel size is extended from the outer edge to the inner edge of the image to be evaluated; the average brightness value of each pixel in the ring-shaped area is calculated and used as the metering value; when the rectangular area is in low light, the average brightness value of each pixel in the rectangular area whose brightness value is greater than the first pixel threshold is calculated and used as the metering value.
2. The infrared image brightness evaluation method as described in claim 1, characterized in that, Within a rectangular area of N*M pixels at the center of the image to be evaluated, the number of pixels with pixel values less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold is counted, including: Obtain a rectangular region of N*M pixels from the center of the image to be evaluated; The rectangular region is segmented using a first pixel threshold to obtain a first binary image, wherein the grayscale value of each pixel in the rectangular region whose brightness value is less than or equal to the first pixel threshold is 0. Obtain the pixels in the first binary image whose grayscale value is 0 and whose brightness value is greater than the second pixel threshold in the rectangular area, and count their number.
3. The infrared image brightness evaluation method as described in claim 1, characterized in that, Within a rectangular area of N*M pixels at the center of the image to be evaluated, the number of pixels with pixel values less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold is counted, including: Obtain a rectangular region of N*M pixels from the center of the image to be evaluated; The rectangular region is segmented using a second pixel threshold to obtain a second binary image; the grayscale value of each pixel in the rectangular region whose brightness value is greater than or equal to the second pixel threshold is 255. Obtain the pixels in the rectangular region whose pixel value is less than or equal to the first pixel threshold and whose grayscale value is 255 in the second binary image, and count their number.
4. The infrared image brightness evaluation method as described in claim 1, characterized in that, The rectangular region is an N*N square region.
5. The infrared image brightness evaluation method as described in claim 1, characterized in that, The The annular region is the area in the image to be evaluated that extends X pixels inward from the outer edge.
6. An exposure control method, characterized in that, The infrared image brightness evaluation method as described in any one of claims 1-5 further includes the following exposure control steps: Based on the measured photometric value and the preset target photometric value, the photometric deviation value is obtained; Determine the exposure adjustment step size based on the measured light deviation value; Based on whether the rectangular area contains highlights or shadows, highlights and shadows are divided into two modes for the exposure control step; The metering deviation value for each mode is divided into several levels according to its numerical value, and each level corresponds to a set of exposure parameters according to the exposure adjustment step size. Exposure parameters are set according to the gear level, and exposure control commands are output to achieve exposure control.
7. An infrared image brightness evaluation device, characterized in that, include: The image acquisition module is used to acquire an infrared image as the image to be evaluated. The rectangular region brightness interval statistics module is used to count the number of pixels whose pixel values are less than or equal to a first pixel threshold and greater than or equal to a second pixel threshold within a rectangular region of the center N*M pixels of the image to be evaluated. A rectangular region highlight / low light determination module is used to compare the ratio of the number of pixels within the aforementioned threshold to the total number of pixels in the rectangular region with a preset ratio threshold to determine whether the rectangular region is a highlight or a low light, including: when the ratio is greater than the preset ratio threshold, determining that the rectangular region is a highlight; when the ratio is less than or equal to the preset ratio threshold, determining that the rectangular region is a low light. The photometric evaluation module is used to calculate the average brightness value of each pixel in the image to be evaluated when the rectangular area is in high light, and to calculate the average brightness value of each pixel in the rectangular area as the photometric value when the rectangular area is in low light, and to calculate the average brightness value of each pixel in the rectangular area whose brightness value is greater than the first pixel threshold as the photometric value.
8. A computer device, characterized in that, The device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that, when the processor executes the computer-readable instructions, it implements the steps of the infrared image brightness evaluation method as described in any one of claims 1 to 5 or the exposure control method as described in claim 6.
9. One or more readable storage media storing computer-readable instructions, characterized in that, When the computer-readable instructions are executed by one or more processors, the one or more processors cause the processors to perform the steps of the infrared image brightness evaluation method as described in any one of claims 1 to 5 or the exposure control method as described in claim 6.
Citation Information
Patent Citations
Image acquisition method and device, electronic equipment and computer readable storage medium
CN110225248A
Recovery of hyperspectral data from image
CN110326022A