A method for resolving mismatch between auto exposure hardware statistics block and software detection block
Patent Information
- Application Number
- CN202210687464.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-16
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2042-06-16
AI Technical Summary
一但测光分区块确定了,再想获取比分区块还小的统计信息就存在瓶颈,也就是说,直接使用硬件统计块的信息存在偏差
[0132] Therefore, the advantages of this application are: this application introduces software statistics to realize details that hardware cannot accurately count; and obtains more accurate statistical information of the detection frame.
Smart Images

Figure CN117291860B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent surveillance video processing technology, and specifically relates to a method for solving the mismatch between automatic exposure hardware statistical blocks and software detection frames. Background Technology
[0002] Traditional automatic exposure algorithms typically employ a segmented metering mode, also known as multi-frame metering, multi-mode metering, or zone-based metering. The main principle is to divide the image into several blocks, measure the brightness of each block, and then perform comprehensive calculations to determine the weighted metering proportion for each block, resulting in an exposure value that takes all blocks into account. However, once the metering blocks are determined, obtaining statistical information smaller than these blocks becomes a bottleneck; in other words, directly using hardware-generated data from these smaller blocks introduces bias.
[0003] In addition, the following are commonly used terms in the prior art:
[0004] Auto Exposure (AE) is a mechanism in which a camera automatically adjusts the exposure and gain based on the intensity of ambient light to prevent overexposure or underexposure.
[0005] A set is a collection of one or more definite elements.
[0006] Intersection: Let A and B be two sets. The set consisting of all elements that belong to both set A and set B is called the intersection of set A and set B.
[0007] Normalization: One method is to transform a number into a decimal between 0 and 1. Summary of the Invention
[0008] To address the aforementioned issues, the purpose of this application is to obtain more accurate statistical information about the detection bounding boxes.
[0009] Specifically, the present invention provides a method for resolving the mismatch between automatic exposure hardware statistics blocks and software detection frames, the method comprising:
[0010] S1, Obtain the detection box information. The detection box information is obtained by the object detection algorithm YOLOv5. The detection box information is a rectangular box represented by two coordinate points: ( , ), ( , ),
[0011] in The x-coordinate of the detection box at the top left corner of the image coordinate system.
[0012] The x-coordinate of the detection box at the bottom right corner of the image coordinate system.
[0013] The detection box is located at the top-left corner of the image coordinate system along the y-axis.
[0014] The y-coordinate of the detection box at the bottom right corner of the image coordinate system;
[0015] Obtain hardware segmentation information, which is user-controlled, to divide the entire image into segments. Each block contains the average values of the four components R / Gr / Gb / B. The value range is 1 to 15. The value range is 1 to 15;
[0016] S2, the intersection of the detection frame and the hardware block:
[0017] Calculate the intersection based on the detection frame and hardware block information;
[0018] S3, Intersection Block Count Condition Judgment:
[0019] Determine if the number of completely contained blocks in the intersection is greater than zero.
[0020] If not, proceed to step S4;
[0021] If so, proceed to step S8;
[0022] S4, calculate the block with the largest intersection between the detection box and the hardware block. ;
[0023] S5, Get Blocks information;
[0024] S6, Obtain the intersection information of detection boxes within the block: Software-level statistics Detection frame information calculation and statistics Block information calculation Hardware-level statistical segmentation Information computing ;
[0025] S7, obtains hardware detection frame statistics based on hardware and software calculations:
[0026] Formula (19)
[0027] in, For hardware based on the detection frame The average brightness value calculated from statistical information;
[0028] For hardware based on blocks The average brightness value calculated from statistical information;
[0029] For the software to detect the frame The average brightness value calculated from statistical information;
[0030] For the software based on blocks The average brightness value calculated from statistical information;
[0031] Next, proceed to step S10;
[0032] S8, directly obtain the intersection block information from step S2. ( , , , ),
[0033] For block The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0034] For block The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0035] For block The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0036] For block The y-axis coordinate of the lower right corner of the hardware block coordinate system;
[0037] Next, proceed to S9;
[0038] S9, obtain hardware statistics information based on block information;
[0039] Divide the entire image into The automatic exposure module can calculate the average value of the four components R / Gr / Gb / B, and use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y4.
[0040] Formula (20)
[0041] calculate Rectangular frame hardware statistics average brightness value ;
[0042] S10, execute the traditional automatic exposure algorithm, wherein the automatic exposure algorithm is: Exposure = Sensitivity. aperture Exposure time.
[0043] Step S2 further includes:
[0044] S2.1, Normalization
[0045] Formula (1)
[0046] in The x-coordinate of the detection box at the top left corner of the image coordinate system.
[0047] The x-coordinate of the detection box at the bottom right corner of the image coordinate system.
[0048] The detection box is located at the top-left corner of the image coordinate system along the y-axis.
[0049] The detection box is located at the bottom right corner of the image coordinate system along the y-axis.
[0050] To normalize the x-axis coordinate of the top left corner of the detection box,
[0051] To normalize the x-axis coordinate of the bottom right corner of the detection box,
[0052] To normalize the y-axis coordinate of the top-left corner of the detection box,
[0053] To normalize the y-axis coordinate of the bottom right corner of the detection box,
[0054] To detect the width of the image,
[0055] To detect the height of the image;
[0056] S2.2. Calculate which block the detection coordinates fall into.
[0057] Formula (2)
[0058] in Number of hardware x-axis blocks
[0059] Number of hardware y-axis blocks;
[0060] For detection box The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0061] For detection box The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0062] For detection box The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0063] For detection box The y-axis coordinate of the lower right corner of the hardware block coordinate system
[0064] S2.3. Calculate the intersection to determine the largest block that the detection box can completely contain.
[0065] ( , , , )
[0066] Formula (3)
[0067] Here, ceil is the floor function.
[0068] floor function for rounding down
[0069] For block The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0070] For block The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0071] For block The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0072] For block The y-axis coordinate is located at the lower right corner of the hardware block coordinate system.
[0073] Step S4 involves obtaining the block with the largest intersection ratio between the detection box and the block; further including:
[0074] S4.1. Calculate the center coordinates of the detection frame
[0075] Formula (5)
[0076] in The x-axis coordinate of the detection box center is...
[0077] The y-axis coordinate of the detection frame center;
[0078] S4.2. Normalization
[0079] Formula (6)
[0080] S4.3. Calculate which block the detection coordinates fall into.
[0081] Formula (7)
[0082] S4.4. Determine if the center coordinates of the detection box are integers.
[0083] S4.4.1. If the center coordinates of the detection frame are not integers, skip to step S5;
[0084] S4.4.2. If the center of the detection box is an integer, determine the relationship between the center coordinates and the position of the image center point, and adopt the principle of being closer to the image center.
[0085] (1) Calculate the x-axis coordinates
[0086] Formula (8)
[0087] (2) Calculate the y-axis coordinate
[0088] Formula (9)
[0089] in, The coordinates of the center of the image on the x-axis are...
[0090] The coordinates of the center of the image's y-axis are...
[0091] .
[0092] Step S5 obtains blocks. information:
[0093] In the hardware block coordinate system ( , , , )
[0094] Formula (10)
[0095] Here, ceil is the floor function.
[0096] floor function for rounding down
[0097] For block The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0098] For block The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0099] For block The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0100] For block The y-axis coordinate of the lower right corner of the hardware block coordinate system
[0101] In the image coordinate system ( , , , )
[0102] Formula (11)
[0103] To detect the width of the image,
[0104] To detect the height of the image;
[0105] Number of hardware x-axis blocks
[0106] Number of hardware y-axis blocks;
[0107] For block The x-axis coordinate of the upper left corner of the image coordinate system
[0108] For block The x-axis coordinate of the lower right corner of the image coordinate system
[0109] For block The y-axis coordinate of the upper left corner of the image coordinate system
[0110] For block The y-axis coordinate is located at the bottom right corner of the image coordinate system.
[0111] Step S6 further includes:
[0112] Software-level calculation of detection boxes within blocks information;
[0113] ( , , , )
[0114] Formula (12)
[0115] For detection box The x-axis coordinate of the upper left corner of the image coordinate system
[0116] For detection box The x-axis coordinate of the lower right corner of the image coordinate system
[0117] For detection box The y-axis coordinate of the upper left corner of the image coordinate system
[0118] For detection box The y-axis coordinate of the lower right corner of the image coordinate system
[0119] The entire image contains R / G / B information for each pixel, obtained by traversing... Rectangular frame
[0120] Use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y1.
[0121] Formula (13)
[0122] calculate Average brightness value of the rectangle ;
[0123] Software-level statistical segmentation Internal information:
[0124] The entire image contains R / G / B information for each pixel, obtained by traversing... Rectangular frame
[0125] Use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y2.
[0126] Formula (15)
[0127] calculate Average brightness value of the rectangle ;
[0128] Hardware statistics blocks Internal information:
[0129] Divide the entire image into The automatic exposure module can calculate the average value of the four components R / Gr / Gb / B, and use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y3.
[0130] Formula (17)
[0131] calculate Average brightness value of the rectangle .
[0132] Therefore, the advantages of this application are: this application introduces software statistics to realize details that hardware cannot accurately count; and obtains more accurate statistical information of the detection frame. Attached Figure Description
[0133] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.
[0134] Figure 1 This is a flowchart illustrating the method of the present invention.
[0135] Figure 2 This is a schematic diagram of the detection frame of the present invention, which completely includes a statistical block.
[0136] Figure 3 This is a schematic diagram of the detection frame of the present invention not completely containing a statistical block.
[0137] Figure 4 This is a flowchart of the present invention for obtaining hardware statistical information of the detection frame. Detailed Implementation
[0138] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.
[0139] like Figure 1 As shown, this invention proposes a method to solve the mismatch between automatic exposure hardware statistics blocks and software detection boxes, the method comprising:
[0140] S1, Obtain detection box information;
[0141] S2, the intersection of the detection frame and the hardware block:
[0142] Calculate the intersection based on the detection frame and hardware block information;
[0143] S3, Intersection Block Count Condition Judgment:
[0144] Determine if the number of completely contained blocks in the intersection is greater than zero.
[0145] If not, proceed to step S4;
[0146] If so, proceed to step S8;
[0147] S4, calculate the block with the largest intersection between the detection box and the hardware block. ;
[0148] S5. Obtain the block information;
[0149] S6. Obtain the intersection information of detection boxes within the block: software-level statistics Detection frame information calculation and statistics Block information calculation Hardware-level statistical segmentation Information computing ;
[0150] S7, obtains hardware detection frame statistics based on hardware and software calculations:
[0151] Formula (19)
[0152] in,
[0153] For hardware based on the detection frame The average brightness value calculated from statistical information;
[0154] For hardware based on blocks The average brightness value calculated from statistical information;
[0155] For the software to detect the frame The average brightness value calculated from statistical information;
[0156] For the software based on blocks The average brightness value calculated from statistical information;
[0157] Next, proceed to step S10;
[0158] S8, Obtain the intersection block information from the result of step S2.
[0159] ( , , , )
[0160] For block The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0161] For block The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0162] For block The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0163] For block The y-axis coordinate of the lower right corner of the hardware block coordinate system;
[0164] Next, proceed to S9;
[0165] S9, obtain hardware statistics information based on block information;
[0166] Divide the entire image into The automatic exposure module can calculate the average value of the four components R / Gr / Gb / B, and use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y4.
[0167]
[0168] calculate:
[0169] Formula (21)
[0170] in, yes The rectangular frame hardware calculates the average brightness value.
[0171] yes The average brightness value of each block within the rectangle.
[0172] For block The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0173] For block The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0174] For block The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0175] For block The y-axis coordinate of the lower right corner of the hardware block coordinate system;
[0176] S10 executes a traditional automatic exposure algorithm (exposure = sensitivity). aperture Exposure time, through analysis of the current scene, calculates and configures appropriate sensitivity, aperture, and exposure time for the image sensor and image signal processing, so that the image sensor output or the image signal processing output before automatic exposure metering reaches a certain brightness.
[0177] Specifically, the main implementation steps of this application embodiment include:
[0178] Step S1. Obtain the detection box information, which is obtained by the target detection algorithm YOLOv5. The detection box information is a rectangular box represented by two coordinate points: ( , ), ( , ),
[0179] in The x-coordinate of the detection box at the top left corner of the image coordinate system.
[0180] The x-coordinate of the detection box at the bottom right corner of the image coordinate system.
[0181] The detection box is located at the top-left corner of the image coordinate system along the y-axis.
[0182] (The y-coordinate of the detection box at the bottom right corner of the image coordinate system)
[0183] Obtain hardware segmentation information, which is user-controlled, to divide the entire image into segments. Each block contains the average values of the four components R / Gr / Gb / B. The value range is 1 to 15. The value range is 1 to 15;
[0184] Step S2. Find the intersection of the detection frame and the hardware block.
[0185] S2.1, Normalization
[0186] Formula (1)
[0187] in The x-coordinate of the detection box at the top left corner of the image coordinate system.
[0188] The x-coordinate of the detection box at the bottom right corner of the image coordinate system.
[0189] The detection box is located at the top-left corner of the image coordinate system along the y-axis.
[0190] The detection box is located at the bottom right corner of the image coordinate system along the y-axis.
[0191] To normalize the x-axis coordinate of the top left corner of the detection box,
[0192] To normalize the x-axis coordinate of the bottom right corner of the detection box,
[0193] To normalize the y-axis coordinate of the top-left corner of the detection box,
[0194] To normalize the y-axis coordinate of the bottom right corner of the detection box,
[0195] To detect the width of the image,
[0196] To detect the height of the image;
[0197] S2.2. Calculate which block the detection coordinates fall into.
[0198] Formula (2)
[0199] in Number of hardware x-axis blocks
[0200] Number of hardware y-axis blocks;
[0201] For the detection box The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0202] For the detection box The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0203] For the detection box The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0204] For the detection box The y-axis coordinate of the lower right corner of the hardware block coordinate system
[0205] S2.3. Calculate the intersection to determine the largest block that the detection box can completely contain.
[0206] ( , , , )
[0207] Formula (3)
[0208] Here, ceil is the floor function.
[0209] floor function for rounding down
[0210] For block The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0211] For block The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0212] For block The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0213] For block The y-axis coordinate of the lower right corner of the hardware block coordinate system
[0214] Step S3. Obtain hardware statistics information for intersection partitioning.
[0215] Number of intersection blocks Formula (4)
[0216] Where n is the number of intersection blocks.
[0217] For the detection box The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0218] For the detection box The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0219] For the detection box The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0220] For the detection box The y-axis coordinate of the lower right corner of the hardware block coordinate system
[0221] judge Whether it is valid,
[0222] If not, i.e. the number of intersection blocks is zero, skip to step S4;
[0223] If so, i.e. the number of intersection blocks is greater than zero, jump to step S8.
[0224] S3.1 The number of intersection blocks is greater than zero (e.g.) Figure 2 (As shown) Directly collect the hardware statistics of the blocks, then jump to step S8;
[0225] S3.2. The number of intersection blocks is equal to zero (e.g., Figure 3 (As shown), skip to step S4;
[0226] Step S4. Recalculate and obtain the block with the largest intersection of the detection boxes.
[0227] S4.1. Calculate the center coordinates of the detection frame
[0228] Formula (5)
[0229] in The x-axis coordinate of the detection box center is...
[0230] The y-axis coordinate of the detection frame center;
[0231] S4.2. Normalization
[0232] Formula (6)
[0233] S4.3. Calculate which block the detection coordinates fall into.
[0234] Formula (7)
[0235] S4.4. Determine if the center coordinates of the detection box are integers.
[0236] S4.4.1. If the center coordinates of the detection frame are not integers, skip to step S5;
[0237] S4.4.2. If the center of the detection box is an integer, determine the relationship between the center coordinates and the position of the image center point, and adopt the principle of being closer to the image center.
[0238] (1) Calculate the x-axis coordinates
[0239] Formula (8)
[0240] (2) Calculate the y-axis coordinate
[0241] Formula (9)
[0242] in, The center coordinates of the image's x-axis
[0243] The center coordinates of the image's y-axis
[0244]
[0245] Step S5. Obtain blocks information:
[0246] In the hardware block coordinate system ( , , , )
[0247] Formula (10)
[0248] Here, ceil is the floor function.
[0249] The floor function rounds down to the nearest integer.
[0250] For block The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0251] For block The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0252] For block The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0253] For block The y-axis coordinate of the lower right corner of the hardware block coordinate system
[0254] In the image coordinate system ( , , , )
[0255] Formula (11)
[0256] To detect the width of the image,
[0257] To detect the height of the image;
[0258] Number of hardware x-axis blocks
[0259] Number of hardware y-axis blocks;
[0260] For block The x-axis coordinate of the upper left corner of the image coordinate system
[0261] For block The x-axis coordinate of the lower right corner of the image coordinate system
[0262] For block The y-axis coordinate of the upper left corner of the image coordinate system
[0263] For block The y-axis coordinate of the lower right corner of the image coordinate system
[0264] Step S6. Obtain the intersection information of the detection boxes within the block.
[0265] Software-level calculation of detection boxes within blocks information;
[0266] ( , , , )
[0267] Formula (12)
[0268] For detection box The x-axis coordinate of the upper left corner of the image coordinate system
[0269] For detection box The x-axis coordinate of the lower right corner of the image coordinate system
[0270] For detection box The y-axis coordinate of the upper left corner of the image coordinate system
[0271] For detection box The y-axis coordinate of the lower right corner of the image coordinate system
[0272] The entire image contains R / G / B information for each pixel, obtained by traversing... Rectangular frame
[0273] Use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y1.
[0274] Formula (13)
[0275] calculate:
[0276] Formula (14)
[0277] in, yes Average brightness value of the rectangle
[0278] yes Brightness value of each pixel within the rectangle
[0279] For detection box The x-axis coordinate of the upper left corner of the image coordinate system
[0280] For detection box The x-axis coordinate of the lower right corner of the image coordinate system
[0281] For detection box The y-axis coordinate of the upper left corner of the image coordinate system
[0282] For detection box The y-axis coordinate at the bottom right corner of the image coordinate system;
[0283] Software-level statistics of information within blocks:
[0284] The entire image contains R / G / B information for each pixel, obtained by traversing... Rectangular frame
[0285] Use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y2.
[0286] Formula (15)
[0287] calculate:
[0288] Formula (16)
[0289] in, yes Average brightness value of the rectangle
[0290] yes Brightness value of each pixel within the rectangle
[0291] For block The x-axis coordinate of the upper left corner of the image coordinate system
[0292] For block The x-axis coordinate of the lower right corner of the image coordinate system
[0293] For block The y-axis coordinate of the upper left corner of the image coordinate system
[0294] For block The y-axis coordinate of the lower right corner of the image coordinate system
[0295] Hardware statistics within the block:
[0296] Divide the entire image into The automatic exposure module can calculate the average value of the four components R / Gr / Gb / B, and use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y3.
[0297] Formula (17)
[0298] calculate:
[0299] Formula (18)
[0300] in, yes Average brightness value of the rectangle
[0301] yes Brightness value of each block within the rectangle
[0302] For block The x-axis coordinate of the upper left corner of the hardware block coordinate system
[0303] For block The x-axis coordinate of the lower right corner of the hardware block coordinate system
[0304] For block The y-axis coordinate of the upper left corner of the hardware block coordinate system
[0305] For block The y-axis coordinate of the lower right corner of the hardware block coordinate system
[0306] Step S7. Calculate hardware detection frame statistics.
[0307] Formula (19);
[0308] Next, proceed to S10;
[0309] Step S8: Obtain the intersection block information; then proceed to S9;
[0310] Step S9: Obtain hardware statistics information based on the block information;
[0311] Step S10: Execute the traditional automatic exposure algorithm.
[0312] In summary, such as Figure 4 The process for obtaining hardware statistics of the detection frame is shown below:
[0313] start,
[0314] S1, Obtain detection box information;
[0315] S2, the intersection of the detection frame and the hardware block.
[0316] S2.1, Obtain hardware block information;
[0317] S2.2, the intersection of the detection box and the block is taken;
[0318] S3, Intersection Block Count Condition Judgment: Determine if the number of completely contained blocks in the intersection is greater than zero?
[0319] If not, then S4,
[0320] If so, then S8;
[0321] S4, obtain the block with the largest intersection ratio between the detection box and the block;
[0322] Calculate the block with the largest intersection of detection boxes
[0323] S5. Obtain the block information;
[0324] S6, Obtain the intersection information of detection boxes within the block: Software-level statistics of detection box information within the block;
[0325] Software-level statistics of information within blocks;
[0326] Hardware statistics within the block;
[0327] S7, obtains hardware detection frame statistics based on hardware and software calculations:
[0328] Formula (19)
[0329] in, Statistical information for hardware detection frames
[0330] Statistical information for hardware statistics blocks
[0331] Statistical information for software detection boxes
[0332] This provides statistical information for the software statistics block.
[0333] Then proceed to step S10;
[0334] S8. Obtain the intersection block information according to the method in step S2;
[0335] S9, obtain hardware statistics information based on block information;
[0336] S10, traditional automatic exposure;
[0337] Finish.
[0338] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for resolving the mismatch between automatic exposure hardware statistics blocks and software detection frames, characterized in that, The method includes: S1, Obtain the detection box information. The detection box information is obtained by the object detection algorithm YOLOv5. The detection box information is a rectangular box represented by two coordinate points: ( , ), ( , ), in The x-coordinate of the detection box at the top left corner of the image coordinate system. The x-coordinate of the detection box at the bottom right corner of the image coordinate system. The detection box is located at the top-left corner of the image coordinate system along the y-axis. The y-coordinate of the detection box at the bottom right corner of the image coordinate system; Obtain hardware segmentation information, which is user-controlled, to divide the entire image into segments. Each block contains the average values of the four components R / Gr / Gb / B. The value range is 1 to 15. The value range is 1 to 15; S2, the intersection of the detection frame and the hardware block: Calculate the intersection based on the detection frame and hardware block information; step S2 further includes: S2.1, Normalization Official (1) in The x-coordinate of the detection box at the top left corner of the image coordinate system. The x-coordinate of the detection box at the bottom right corner of the image coordinate system. The detection box is located at the top-left corner of the image coordinate system along the y-axis. The detection box is located at the bottom right corner of the image coordinate system along the y-axis. To normalize the x-axis coordinate of the top left corner of the detection box, To normalize the x-axis coordinate of the bottom right corner of the detection box, To normalize the y-axis coordinate of the top-left corner of the detection box, To normalize the y-axis coordinate of the bottom right corner of the detection box, To detect the width of the image, To detect the height of the image; S2.2, Calculate which block the detection coordinates fall into. Official (2) in Number of hardware x-axis blocks Number of hardware y-axis blocks; For the detection box The x-axis coordinate of the upper left corner of the hardware block coordinate system For the detection box The x-axis coordinate of the lower right corner of the hardware block coordinate system For the detection box The y-axis coordinate of the upper left corner of the hardware block coordinate system For the detection box The y-axis coordinate of the lower right corner of the hardware block coordinate system S2.3, calculate the intersection to determine the largest block that the detection box can completely contain. ; ( , , , ) Official (3) Here, ceil is the floor function. floor function for rounding down For block The x-axis coordinate of the upper left corner of the hardware block coordinate system For block The x-axis coordinate of the lower right corner of the hardware block coordinate system For block The y-axis coordinate of the upper left corner of the hardware block coordinate system For block The y-axis coordinate of the lower right corner of the hardware block coordinate system; S3, Intersection Block Count Condition Judgment: Determine if the number of completely contained blocks in the intersection is greater than zero. If not, proceed to step S4; If so, proceed to step S8; S4, calculate the block with the largest intersection between the detection box and the hardware block. ; S5, Get Blocks Information; this block The block with the largest intersection between the detection frame and the hardware block in step S4; based on this block The overlapping area of the detection box is calculated as... ; S6, Obtain the intersection information of detection boxes within the block: Software-level statistics Detection frame information calculation and statistics Block information calculation Hardware-level statistical segmentation Information computing ; S7, obtains hardware detection frame statistics based on hardware and software calculations: Official (19) in, For hardware based on the detection frame The average brightness value calculated from statistical information; For hardware based on blocks The average brightness value calculated from statistical information; For the software to detect the frame The average brightness value calculated from statistical information; For the software based on blocks The average brightness value calculated from statistical information; Next, proceed to step S10; S8, directly obtain the intersection block information from step S2. ( , , , ), For block The x-axis coordinate of the upper left corner of the hardware block coordinate system For block The x-axis coordinate of the lower right corner of the hardware block coordinate system For block The y-axis coordinate of the upper left corner of the hardware block coordinate system For block The y-axis coordinate of the lower right corner of the hardware block coordinate system; Next, proceed to S9; S9, obtain hardware statistics information based on block information; Divide the entire image into The automatic exposure module can calculate the average value of the four components R / Gr / Gb / B, and use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y4. Official (20) calculate Rectangular frame hardware statistics average brightness value ; S10, based on the statistical brightness information calculated in step S7 or S9, execute a traditional automatic exposure algorithm, wherein the automatic exposure algorithm is: Exposure = Sensitivity. aperture Exposure time.
2. The method for resolving the mismatch between automatic exposure hardware statistics blocks and software detection frames according to claim 1, characterized in that, Step S4 involves obtaining the block with the largest intersection ratio between the detection box and the block; further including: S4.
1. Calculate the center coordinates of the detection frame Official (5) in The x-axis coordinate of the detection box center is... The y-axis coordinate of the detection frame center; S4.
2. Normalization Official (6) S4.
3. Calculate which block the detection coordinates fall into. Official (7) S4.
4. Determine if the center coordinates of the detection box are integers. S4.4.
1. If the center coordinates of the detection frame are not integers, skip to step S5; S4.4.
2. If the center of the detection box is an integer, determine the relationship between the center coordinates and the position of the image center point, and adopt the principle of being closer to the image center. (1) Calculate the x-axis coordinates Official (8) (2) Calculate the y-axis coordinate Official (9) The coordinates of the center of the image on the x-axis are... The coordinates of the center of the image's y-axis are... 。 3. The method for resolving the mismatch between automatic exposure hardware statistics blocks and software detection frames according to claim 2, characterized in that, Step S5 obtains blocks. information: In the hardware block coordinate system ( , , , ) Official (10) Here, ceil is the floor function. floor function for rounding down For block The x-axis coordinate of the upper left corner of the hardware block coordinate system For block The x-axis coordinate of the lower right corner of the hardware block coordinate system For block The y-axis coordinate of the upper left corner of the hardware block coordinate system For block The y-axis coordinate of the lower right corner of the hardware block coordinate system In the image coordinate system ( , , , ) Official (11) To detect the width of the image, To detect the height of the image; Number of hardware x-axis blocks Number of hardware y-axis blocks; For block The x-axis coordinate of the upper left corner of the image coordinate system For block The x-axis coordinate of the lower right corner of the image coordinate system For block The y-axis coordinate of the upper left corner of the image coordinate system For block The y-axis coordinate is located at the bottom right corner of the image coordinate system.
4. The method for resolving the mismatch between automatic exposure hardware statistics blocks and software detection frames according to claim 3, characterized in that, Step S6 further includes: Software-level calculation of detection boxes within blocks information: ( , , , ) Official (12) For detection box The x-axis coordinate of the upper left corner of the image coordinate system For detection box The x-axis coordinate of the lower right corner of the image coordinate system For detection box The y-axis coordinate of the upper left corner of the image coordinate system For detection box The y-axis coordinate of the lower right corner of the image coordinate system The entire image contains R / G / B information for each pixel, obtained by traversing... Rectangular frame Use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y1. Official (13) calculate Average brightness value of the rectangle ; Software-level statistical segmentation Internal information: The entire image contains R / G / B information for each pixel, obtained by traversing... Rectangular frame Use the BT601 standard to convert the R / G / B values within the rectangle into luminance information y2. Official (15) calculate Average brightness value of the rectangle ; Hardware statistics blocks Internal information: Divide the entire image into The system is divided into blocks, and the automatic exposure module calculates the average value of the four components R / Gr / Gb / B. Using the BT601 standard, the R / G / B values within the rectangular frame are converted into luminance information y3. Official (17) calculate Average brightness value of the rectangle .
Citation Information
Patent Citations
Exposure adaptive adjustment method based on face brightness
CN110610176A
Method, system and device for adjusting face exposure brightness in backlight scene and medium
CN114331870A