CN109922274B - Camera highlight suppression method and device based on histogram - Google Patents

Camera highlight suppression method and device based on histogram Download PDF

Info

Publication number
CN109922274B
CN109922274B CN201711332525.5A CN201711332525A CN109922274B CN 109922274 B CN109922274 B CN 109922274B CN 201711332525 A CN201711332525 A CN 201711332525A CN 109922274 B CN109922274 B CN 109922274B
Authority
CN
China
Prior art keywords
bright
threshold
block
blocks
threshold value
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.)
Active
Application number
CN201711332525.5A
Other languages
Chinese (zh)
Other versions
CN109922274A (en
Inventor
许培培
李修新
范铁道
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Infinova Ltd
Original Assignee
Shenzhen Infinova 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 Shenzhen Infinova Ltd filed Critical Shenzhen Infinova Ltd
Priority to CN201711332525.5A priority Critical patent/CN109922274B/en
Publication of CN109922274A publication Critical patent/CN109922274A/en
Application granted granted Critical
Publication of CN109922274B publication Critical patent/CN109922274B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The invention provides a camera strong light inhibition method and device based on a histogram, which can realize automatic identification and inhibition of strong light in a camera shooting picture based on statistical information of the histogram, can effectively inhibit scene application such as car lamp strong light and the like in the shooting process of the camera, and can enable other information except the strong light, such as a license plate, to be clearly exposed. In addition, under the condition that the strong light disappears, the picture of the camera can be automatically detected and restored to a normal scene, so that the accuracy of capturing and identifying the picture attention information under the condition of accidental strong light is greatly improved, and the normal use of the camera is not influenced.

Description

Camera highlight suppression method and device based on histogram
Technical Field
The invention relates to a camera image optimization method, in particular to a camera strong light suppression method and device based on a histogram.
Background
In the field of security monitoring, license plate identification is a very important application, and the prior bayonet cameras are all provided with automatic license plate identification modules, so that the license plates of vehicles can be prepared to be captured and identified. However, at night, under the condition that the car light is turned on, the camera captures the picture of the license plate, the license plate is usually submerged under strong light due to the strong light effect of the car light, so that the license plate is difficult to accurately position, and the recognition rate of the characters of the license plate is greatly reduced.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: a histogram-based camera glare suppression method and apparatus are provided that can effectively suppress the effects of glare on the subject of recognition in the camera view.
In order to solve the technical problems, the invention adopts the technical scheme that: a histogram-based camera glare suppression method includes the steps of,
dividing a shot picture into blocks according to grids;
s2) storing the histogram statistical information of the current shot picture as the original histogram statistical information;
s3) executing a bright spot discrimination sub-process, a bright block discrimination sub-process;
the bright point discrimination sub-process includes the steps of:
s311) judging whether the pixel point in the histogram statistical information of the current shooting picture is a bright point or not according to the first threshold;
s312) counting the number of the bright spots;
the bright block judging sub-process comprises the following steps:
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
s4) comparing the number of bright spots with a third threshold, the number of bright blocks with a fourth threshold, continuing with step S5 if the number of bright spots exceeds the third threshold while the number of bright blocks exceeds the fourth threshold, going to step S6 if the number of bright spots is less than the third threshold while the number of bright blocks is less than the fourth threshold, going back to step S2 if the number of bright spots is equal to the third threshold while the number of bright blocks is equal to the fourth threshold;
s5) adjusting the exposure value of the camera, and then returning to step S3;
s6) the exposure value of the camera is recalled, and then, the process returns to step S2.
In the above, in the step S5, the exposure value of the camera is adjusted according to the first step length, and then the process returns to the step S3; the first step length and the second step length dynamically change according to the difference value between the bright point number and the third threshold value and the difference value between the bright block number and the fourth threshold value, and if the difference value is larger, the first step length and the second step length are larger.
The invention also relates to a camera strong light suppression method based on the histogram, which comprises the steps of,
dividing a shot picture into blocks according to grids;
s2) storing the histogram statistical information of the current shot picture as the original histogram statistical information;
s3) executing a bright spot discrimination sub-process, a bright block discrimination sub-process;
the bright point discrimination sub-process includes the steps of:
s311) judging whether the pixel point in the histogram statistical information of the current shooting picture is a bright point or not according to the first threshold;
s312) counting the number of the bright spots;
the bright block judging sub-process comprises the following steps:
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
s4) comparing the number of bright spots with a third threshold, the number of bright blocks with a fourth threshold, continuing with step S5 if the number of bright spots exceeds the third threshold while the number of bright blocks exceeds the fourth threshold, going to step S6 if the number of bright spots is less than the third threshold while the number of bright blocks is less than the fourth threshold, going back to step S2 if the number of bright spots is equal to the third threshold while the number of bright blocks is equal to the fourth threshold;
s5) switching the camera into the wide dynamic mode, and then returning to step S3;
s6) enters the normal mode, and then returns to step S2.
In the above, the third threshold and the fourth threshold include a plurality of selectable values; the histogram-based camera glare suppression method further includes the step of selecting a third threshold value and a fourth threshold value from a plurality of selectable values.
In the above, in step S321, the bright block determination is performed by one or more of the following methods:
1) judging whether a pixel point in the histogram statistical information of each block of the current shot picture is a bright point or not according to the first threshold, and counting whether the number of the bright points exceeds a fifth threshold is a bright block;
2) carrying out sectional statistics on the histogram statistical information of each block of the current shot picture according to a BIN threshold value to obtain a bright spot proportion, wherein the bright spot proportion exceeds a sixth threshold value and is a bright block;
3) and counting the overall brightness mean value of the current shot picture, then respectively calculating the deviation degree of each block of the current shot picture from the overall brightness mean value, and judging whether the deviation degree exceeds a seventh threshold value as a bright block.
In the foregoing, the bright block distinguishing sub-process specifically includes the steps of:
s320) setting a two-dimensional array corresponding to the shooting picture according to the grid division blocks, wherein the initialization number of the two-dimensional array is 0;
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
assigning the position of the corresponding judged bright block in the two-dimensional array as 1;
s323) counting the number of adjacent bright blocks of each bright block as 1;
s324) if the number of the 1 in the two-bit array exceeds the eighth threshold, the third threshold and the fourth threshold are reduced, otherwise, the third threshold and the fourth threshold are increased.
The invention also provides a camera strong light suppression device based on the histogram, which comprises
The dividing module is used for dividing the shot picture into blocks according to grids;
the current storage module is used for storing the histogram statistical information of the current shot picture as original histogram statistical information and then transferring the original histogram statistical information to the judgment module;
the judging module comprises a bright spot judging submodule and a bright block judging submodule and then transfers to the comparing module;
the bright spot discriminating submodule includes:
the bright point judging unit is used for judging whether pixel points in the histogram statistical information of the current shot picture are bright points according to the first threshold value and then switching to the bright point statistical unit;
the bright spot counting unit is used for counting the number of the bright spots;
the bright block discrimination submodule includes:
the bright block judging unit judges whether the block of the current shot picture is a bright block according to a second threshold value and then transfers the block to the bright block counting unit;
a bright block counting unit for counting the number of bright blocks;
the comparison module is used for comparing the number of the bright spots with a third threshold value and the number of the bright blocks with a fourth threshold value, if the number of the bright spots exceeds the third threshold value and the number of the bright blocks exceeds the fourth threshold value, the adjustment module is switched to, if the number of the bright spots is smaller than the third threshold value and the number of the bright blocks is smaller than the fourth threshold value, the callback module is switched to, and if the number of the bright spots is equal to the third threshold value and the number of the bright blocks is equal to the fourth threshold value, the current storage module is switched;
the adjusting module is used for adjusting the exposure value of the camera and then switching back to the judging module;
and the callback module is used for calling back the exposure value of the camera and then transferring the exposure value back to the current storage module.
In the above, in the step S5, the exposure value of the camera is adjusted according to the first step length, and then the process returns to the step S3; the first step length and the second step length dynamically change according to the difference value between the bright point number and the third threshold value and the difference value between the bright block number and the fourth threshold value, and if the difference value is larger, the first step length and the second step length are larger.
The invention further provides a histogram-based camera glare suppression apparatus, comprising the steps of,
the dividing module is used for dividing the shot picture into blocks according to grids;
the current storage module is used for storing the histogram statistical information of the current shot picture as original histogram statistical information and then transferring the original histogram statistical information to the judgment module;
the judging module comprises a bright spot judging submodule and a bright block judging submodule and then transfers to the comparing module;
the bright spot discriminating submodule includes:
the bright point judging unit is used for judging whether pixel points in the histogram statistical information of the current shot picture are bright points according to the first threshold value and then switching to the bright point statistical unit;
the bright spot counting unit is used for counting the number of the bright spots;
the bright block discrimination submodule includes:
the bright block judging unit judges whether the block of the current shot picture is a bright block according to a second threshold value and then transfers the block to the bright block counting unit;
a bright block counting unit for counting the number of bright blocks;
the comparison module is used for comparing the number of the bright spots with a third threshold value and the number of the bright blocks with a fourth threshold value, if the number of the bright spots exceeds the third threshold value and the number of the bright blocks exceeds the fourth threshold value, the adjustment module is switched to, if the number of the bright spots is smaller than the third threshold value and the number of the bright blocks is smaller than the fourth threshold value, the callback module is switched to, and if the number of the bright spots is equal to the third threshold value and the number of the bright blocks is equal to the fourth threshold value, the current storage module is switched;
the adjusting module is used for switching the camera to enter a wide dynamic mode and then switching back to the judging module;
and the call-back module is used for switching the camera to enter a common mode and then switching back to the current storage module.
In the foregoing, the bright block determination unit specifically includes:
the array establishing unit is used for setting a two-dimensional array corresponding to the shot picture divided into blocks according to grids, the initialization number of the two-dimensional array is 0, and then the two-dimensional array is transferred to the bright block judging unit;
the bright block judging unit is used for judging whether the block of the current shot picture is a bright block according to a second threshold value and then switching to the bright block counting unit;
the bright block counting unit is used for counting the number of bright blocks, correspondingly judging the bright block position in the two-dimensional array to be 1, and then switching to the array counting unit;
the array counting unit is used for counting the number of the adjacent bright blocks of each bright block to be 1 and then switching to the threshold value adjusting unit;
and the threshold adjusting unit is used for reducing the third threshold and the fourth threshold when the number of the 1 in the two-bit array exceeds the eighth threshold, and otherwise, increasing the third threshold and the fourth threshold.
The invention has the beneficial effects that: the automatic identification and inhibition of the strong light in the camera shooting picture are realized based on the statistical information of the histogram, the scene application such as the strong light of the car lamp in the camera shooting process can be effectively inhibited, and other information except the strong light, such as the license plate, can be clearly exposed. In addition, under the condition that the strong light disappears, the picture of the camera can be automatically detected and restored to a normal scene, so that the accuracy of capturing and identifying the picture attention information under the condition of accidental strong light is greatly improved, and the normal use of the camera is not influenced.
Drawings
The detailed structure of the invention is described in detail below with reference to the accompanying drawings
FIG. 1 is a flow chart of an embodiment of the method of the present invention;
FIG. 2 is a flowchart of an embodiment of the method of the present invention.
Detailed Description
In order to explain technical contents, structural features, and objects and effects of the present invention in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
At night intersections, particularly intersections with heavy traffic, under the condition that the vehicle lamps are turned on, images captured by the cameras are partially exposed abnormally, the license plates are completely submerged in halos of the vehicle lamps, and the cameras cannot locate the license plates. In the mode 1, the exposure target value of the camera is mainly controlled, so that the aims of inhibiting the brightness and the halation of the vehicle lamp are fulfilled, the license plate is clearly exposed, and the camera is convenient for positioning and capturing the license plate and identifying characters of the license plate. Meanwhile, the vehicle is in a moving state, namely, the lamp can continuously appear and disappear, so that under the condition that the lamp disappears, the picture of the camera automatically returns to the state before the lamp appears.
Due to the diversity of practical application scenes, the design is based on the histogram statistical information of the camera image, and two different modes of automatic vehicle lamp suppression technologies are realized.
The first mode is as follows: the method mainly utilizes the histogram statistical information of the camera image to control the exposure target value of the camera so as to achieve the purpose of inhibiting the vehicle lamp.
Referring to fig. 1, the present invention provides a camera glare suppression method based on histogram, comprising the steps of,
dividing a shot picture into blocks according to grids;
preferably, for the judgment of the subsequent bright blocks of the quota, the whole frame can be divided into 255 small blocks.
S2) storing the histogram statistical information of the current shot picture as the original histogram statistical information;
s3) executing a bright spot discrimination sub-process, a bright block discrimination sub-process;
the bright point discrimination sub-process includes the steps of:
s311) judging whether the pixel point in the histogram statistical information of the current shooting picture is a bright point or not according to the first threshold;
s312) counting the number of the bright spots;
in one mode, the bright spots may be determined based on 256 pieces of histogram statistical information, and the number of bright spots in the statistical frame that are greater than a certain threshold is determined as the bright spots.
The bright block judging sub-process comprises the following steps:
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
the method is characterized in that the bright spot is utilized, the second available characteristic is the bright block, and then 255 blocks divided in the previous example are scanned in a circulating manner to count the number of the 255 blocks belonging to the bright block.
S4) comparing the number of bright spots with a third threshold, the number of bright blocks with a fourth threshold, continuing with step S5 if the number of bright spots exceeds the third threshold while the number of bright blocks exceeds the fourth threshold, going to step S6 if the number of bright spots is less than the third threshold while the number of bright blocks is less than the fourth threshold, going back to step S2 if the number of bright spots is equal to the third threshold while the number of bright blocks is equal to the fourth threshold;
only when the bright block and the bright spot in the picture reach a certain threshold value, whether the block belongs to the bright block or not is judged, and the bright spot and the bright block both reach the threshold value, the picture is judged to be a highlight scene, so that the subsequent highlight inhibition is started.
S5) adjusting the exposure value of the camera, and then returning to step S3;
when the scene is judged to be a strong light scene, the step starts to carry out strong light inhibition by adjusting the exposure value of the camera.
S6) the exposure value of the camera is recalled, and then, the process returns to step S2.
In conclusion, the histogram-based statistical information provided by the invention can automatically identify and inhibit the strong light in the camera shooting picture, can effectively inhibit the scene application such as the strong light of the car lamp in the shooting process of the camera, and can clearly expose other information except the strong light, such as the license plate. In addition, under the condition that the strong light disappears, the camera picture can be automatically detected and restored to a normal scene, so that the accuracy of capturing and identifying the picture attention information under the condition of accidental strong light can be greatly improved, and the normal use of the camera is not influenced.
The technology of the invention is suitable for inhibiting the situation of accidental strong light in the shooting process of various cameras, and is particularly suitable for identifying the license plate of a vehicle under the strong light of the vehicle lamp shot by the camera. In addition, in order to better capture and identify the license plate, in the process of suppressing the strong light of the car lamp, the image enhancement technology is utilized to enhance the license plate effect, so that the recognition of license plate characters by a camera is facilitated, the license plate image enhancement mainly adopts the histogram equalization technology, the license plate part can be well promoted by utilizing the technology, and meanwhile, part of car lamp halation can be suppressed.
The mode one mainly realizes two kinds of functions, first be exactly when the car light appears, can restrain the car light, make the license plate show out, the second is exactly when the car light disappears, the picture can revert to normal condition, and the suppression intensity of car light still can be according to how much automatically regulated of car light, also be when the car light is less in the picture, the suppression of car light is weak, and when a plurality of car lights appear in the picture, the suppression of car light just will be some more strong this moment, and the car light suppression intensity can also be according to the difference of scene, the individual difference of liking of customer, the suppression intensity of autonomic selection car light.
If necessary, step S1) may be added before step S2) to determine whether the current shooting scene is in the daytime state or in the nighttime state, and a third threshold and a fourth threshold are set corresponding to the daytime state or the nighttime state.
The purpose of adding this step is to distinguish the scenes of day and night at the beginning of the inhibition, because in the day, when the sunlight is abnormally strong, the picture is captured from the camera, the recognition degree of the license plate is not very high, so that the day and the night are distinguished. The distinction between the day and the night is mainly judged by using the gain of the camera and the information of the dark points and the dark blocks, when the gain, the dark points and the dark blocks exceed a certain range, the current scene is judged to be in a night state, the day and the night are separated for processing, the processing methods of the day and the night are approximately the same, and only the third threshold and the fourth threshold are different.
Example 1
In the step S5, the exposure value of the camera is adjusted according to the first step length, and then the process returns to the step S3; in the step S6, the exposure value of the camera is adjusted back according to the second step length, and then the process returns to the step S2; the first step length and the second step length dynamically change according to the difference value between the bright point number and the third threshold value and the difference value between the bright block number and the fourth threshold value, and if the difference value is larger, the first step length and the second step length are larger.
Therefore, the current strong light degree is known through the difference value between the bright point number and the third threshold value and the difference value between the bright block number and the fourth threshold value, and the dynamic first step length and the dynamic second step length can be dynamically changed according to the strong light degree to achieve the purpose of fast adjustment for adapting to the strong light environment.
The embodiment dynamically sets the adjustment step length of the exposure target value, namely different step lengths are set according to the strong light degree of the picture, so that the picture can be prevented from flickering, different adjustment step lengths are set by calculating the deviation degree of the current bright point and bright block value and the threshold value, when the deviation degree is large, the adjustment step length is large, the car light inhibition effect is fast, when the deviation degree is small, when the picture is close to an ideal scene, the adjustment step length at the moment is small, and besides the design is in accordance with practical use, the flicker and oscillation of the picture can be prevented.
Example 2
The third threshold and the fourth threshold comprise a plurality of selectable values; the histogram-based camera glare suppression method further includes the step of selecting a third threshold value and a fourth threshold value from a plurality of selectable values.
The setting of the threshold is one of the key points of the patent technology, and if the threshold is set more singly, the threshold can be used, but the characteristic of weak scene adaptability can also occur, namely, a non-highlight scene is possibly judged to be a highlight scene, and the highlight scene is supposed to be a highlight scene, and is judged to be a non-highlight scene.
In the solution of this embodiment, in order to improve the flexibility, the third threshold and the fourth threshold are set by introducing a level idea, that is, the setting of the third threshold and the fourth threshold is dynamic, that is, different thresholds are allowed to be set according to different scenes, and different thresholds are allowed to be set according to different resolutions. Therefore, the method can be applied to the environment without using the camera, for example, the number of street lamps in some scenes is high, the number of street lamps in some scenes is low, the third threshold value and the fourth threshold value comprise a plurality of selectable values to form a plurality of adjustment levels, for example, the levels are divided into 16 levels in one mode, so that a user can select different levels according to the actual installation scene of the camera, and set different third threshold values and fourth threshold values.
Example 3
In step S321, the bright block determination is performed in one or more of the following manners:
1) judging whether a pixel point in the histogram statistical information of each block of the current shot picture is a bright point or not according to the first threshold, and counting whether the number of the bright points exceeds a fifth threshold is a bright block;
2) carrying out sectional statistics on the histogram statistical information of each block of the current shot picture according to a BIN threshold value to obtain a bright spot proportion, wherein the bright spot proportion exceeds a sixth threshold value and is a bright block;
3) and counting the overall brightness mean value of the current shot picture, then respectively calculating the deviation degree of each block of the current shot picture from the overall brightness mean value, and judging whether the deviation degree exceeds a seventh threshold value as a bright block.
Example 4
The bright block judging sub-process specifically comprises the following steps:
s320) setting a two-dimensional array corresponding to the division and the blocking of the shot picture according to the grid, and initializing the two-dimensional array
The number is 0;
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
assigning the position of the corresponding judged bright block in the two-dimensional array as 1;
s323) counting the number of adjacent bright blocks of each bright block as 1;
s324) if the number of the 1 in the two-bit array exceeds the eighth threshold, the third threshold and the fourth threshold are reduced so as to increase the suppression degree, otherwise, the third threshold and the fourth threshold are increased so as to reduce the suppression strength.
The technical scheme of the embodiment is that a set of intelligent brightness suppression adjustment is designed by utilizing a connected domain thought in order to match subjective feelings of people. The principle is to utilize the connected domain of the bright block to self-adaptively adjust the threshold of the bright block. From the subjective feeling of people, when the bright blocks of the picture are different in dispersion and concentration, the definition of the license plate and the subjective feeling of people are different, when the bright blocks are more dispersed, the strong light inhibition degree is weaker, and when the bright blocks of the picture are more concentrated, the inhibition strength of the vehicle lamp is stronger. The judgment threshold of the bright block is set differently according to the dispersion and concentration degree of the bright block, when the bright block of the picture is counted, a two-dimensional array corresponding to 255 blocks is set, the array is 0 when initialized, when the block is judged to be the bright block, the position of the corresponding two-dimensional array is assigned to be 1, after the 255 blocks are scanned, the concentration degree of the bright block is judged by counting 8 neighborhoods of each block and looking at the number of the median value of the 8 neighborhoods to be 1, and when the concentration degree is higher, the inhibition degree of the car lamp at the moment is correspondingly stronger and conversely is weaker.
In order to better adapt to different scenes, the invention also provides another mode of a highlight (particularly car lamp highlight) suppression strategy, when the camera is installed at a doorway of a cell or an underground parking lot, when a car lamp appears, the highlight is mainly distributed at a specific position in a picture and is similar to a scene that the camera looks outdoors from indoors, so the design adapts to the scene of the cell or the underground parking lot by utilizing the wide dynamic function of the camera, namely, when the car lamp appears, the wide dynamic function of the camera is turned on, and when the car lamp disappears, the wide dynamic function of the camera is turned off, and because the whole picture has a frosting phenomenon if the wide dynamic function is turned on in a normal scene, the wide dynamic function is turned off in the normal scene.
And a second mode: the aim of restraining the car lamp is achieved mainly by controlling the wide dynamic switch of the camera.
Referring to fig. 2, the present invention further provides a camera glare suppression method based on histogram, comprising the steps of,
dividing a shot picture into blocks according to grids;
preferably, for the judgment of the subsequent bright blocks of the quota, the whole frame can be divided into 255 small blocks.
S2) storing the histogram statistical information of the current shot picture as the original histogram statistical information;
s3) executing a bright spot discrimination sub-process, a bright block discrimination sub-process;
the bright point discrimination sub-process includes the steps of:
s311) judging whether the pixel point in the histogram statistical information of the current shooting picture is a bright point or not according to the first threshold;
s312) counting the number of the bright spots;
in one mode, the bright spots may be determined based on 256 pieces of histogram statistical information, and the number of bright spots in the statistical frame that are greater than a certain threshold is determined as the bright spots.
The bright block judging sub-process comprises the following steps:
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
the method is characterized in that the bright spot is utilized, the second available characteristic is the bright block, and then 255 blocks divided in the previous example are scanned in a circulating manner to count the number of the 255 blocks belonging to the bright block.
S4) comparing the number of bright spots with a third threshold, the number of bright blocks with a fourth threshold, continuing with step S5 if the number of bright spots exceeds the third threshold while the number of bright blocks exceeds the fourth threshold, going to step S6 if the number of bright spots is less than the third threshold while the number of bright blocks is less than the fourth threshold, going back to step S2 if the number of bright spots is equal to the third threshold while the number of bright blocks is equal to the fourth threshold;
only when the bright block and the bright spot in the picture reach a certain threshold value, whether the block belongs to the bright block or not is judged, and the bright spot and the bright block both reach the threshold value, the picture is judged to be a highlight scene, so that the subsequent highlight inhibition is started.
S5) switching the camera into the wide dynamic mode, and then returning to step S3;
when the scene is judged to be a strong light scene, the step starts to carry out strong light inhibition by adjusting the exposure value of the camera.
S6) enters the normal mode, and then returns to step S2.
In conclusion, the histogram-based statistical information provided by the invention can automatically identify and inhibit the strong light in the camera shooting picture, can effectively inhibit the scene application such as the strong light of the car lamp in the shooting process of the camera, and can clearly expose other information except the strong light, such as the license plate. In addition, under the condition that the strong light disappears, the camera picture can be automatically detected and restored to a normal scene, so that the accuracy of capturing and identifying the picture attention information under the condition of accidental strong light can be greatly improved, and the normal use of the camera is not influenced.
The technology of the invention is suitable for inhibiting the situation of accidental strong light in the shooting process of various cameras, and is particularly suitable for identifying the license plate of a vehicle under the strong light of the vehicle lamp shot by the camera. In addition, in order to better capture and identify the license plate, in the process of suppressing the strong light of the car lamp, the image enhancement technology is utilized to enhance the license plate effect, so that the recognition of license plate characters by a camera is facilitated, the license plate image enhancement mainly adopts the histogram equalization technology, the license plate part can be well promoted by utilizing the technology, and meanwhile, part of car lamp halation can be suppressed.
If necessary, step S1) may be added before step S2) to determine whether the current shooting scene is in the daytime state or in the nighttime state, and a third threshold and a fourth threshold are set corresponding to the daytime state or the nighttime state.
The purpose of adding this step is to distinguish the scenes of day and night at the beginning of the inhibition, because in the day, when the sunlight is abnormally strong, the picture is captured from the camera, the recognition degree of the license plate is not very high, so that the day and the night are distinguished. The distinction between the day and the night is mainly judged by using the gain of the camera and the information of the dark points and the dark blocks, when the gain, the dark points and the dark blocks exceed a certain range, the current scene is judged to be in a night state, the day and the night are separated for processing, the processing methods of the day and the night are approximately the same, and only the third threshold and the fourth threshold are different.
Example 5
The third threshold and the fourth threshold comprise a plurality of selectable values; the histogram-based camera glare suppression method further includes the step of selecting a third threshold value and a fourth threshold value from a plurality of selectable values.
The setting of the threshold is one of the key points of the patent technology, and if the threshold is set more singly, the threshold can be used, but the characteristic of weak scene adaptability can also occur, namely, a non-highlight scene is possibly judged to be a highlight scene, and the highlight scene is supposed to be a highlight scene, and is judged to be a non-highlight scene.
In the solution of this embodiment, in order to improve the flexibility, the third threshold and the fourth threshold are set by introducing a level idea, that is, the setting of the third threshold and the fourth threshold is dynamic, that is, different thresholds are allowed to be set according to different scenes, and different thresholds are allowed to be set according to different resolutions. Therefore, the method can be applied to the environment without using the camera, for example, the number of street lamps in some scenes is high, the number of street lamps in some scenes is low, the third threshold value and the fourth threshold value comprise a plurality of selectable values to form a plurality of adjustment levels, for example, the levels are divided into 16 levels in one mode, so that a user can select different levels according to the actual installation scene of the camera, and set different third threshold values and fourth threshold values.
Example 6
In step S321, the bright block determination is performed in one or more of the following manners:
1) judging whether a pixel point in the histogram statistical information of each block of the current shot picture is a bright point or not according to the first threshold, and counting whether the number of the bright points exceeds a fifth threshold is a bright block;
2) carrying out sectional statistics on the histogram statistical information of each block of the current shot picture according to a BIN threshold value to obtain a bright spot proportion, wherein the bright spot proportion exceeds a sixth threshold value and is a bright block;
3) and counting the overall brightness mean value of the current shot picture, then respectively calculating the deviation degree of each block of the current shot picture from the overall brightness mean value, and judging whether the deviation degree exceeds a seventh threshold value as a bright block.
Example 7
The bright block judging sub-process specifically comprises the following steps:
s320) setting a two-dimensional array corresponding to the shooting picture according to the grid division blocks, wherein the initialization number of the two-dimensional array is 0;
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
assigning the position of the corresponding judged bright block in the two-dimensional array as 1;
s323) counting the number of adjacent bright blocks of each bright block as 1;
s324) if the number of 1 in the two-bit array exceeds the eighth threshold, the third threshold and the fourth threshold are reduced so as to increase the suppression degree, otherwise, the third threshold and the fourth threshold are increased so as to reduce the suppression strength
The technical scheme of the embodiment is that a set of intelligent brightness suppression adjustment is designed by utilizing a connected domain thought in order to match subjective feelings of people. The principle is to utilize the connected domain of the bright block to self-adaptively adjust the threshold of the bright block. From the subjective feeling of people, when the bright blocks of the picture are different in dispersion and concentration, the definition of the license plate and the subjective feeling of people are different, when the bright blocks are more dispersed, the strong light inhibition degree is weaker, and when the bright blocks of the picture are more concentrated, the inhibition strength of the vehicle lamp is stronger. The judgment threshold of the bright block is set differently according to the dispersion and concentration degree of the bright block, when the bright block of the picture is counted, a two-dimensional array corresponding to 255 blocks is set, the array is 0 when initialized, when the block is judged to be the bright block, the position of the corresponding two-dimensional array is assigned to be 1, after the 255 blocks are scanned, the concentration degree of the bright block is judged by counting 8 neighborhoods of each block and looking at the number of the median value of the 8 neighborhoods to be 1, and when the concentration degree is higher, the inhibition degree of the car lamp at the moment is correspondingly stronger and conversely is weaker.
The first mode is as follows: the method mainly utilizes the histogram statistical information of the camera image to control the exposure target value of the camera so as to achieve the purpose of inhibiting the vehicle lamp.
The invention also provides a camera highlight suppression device based on the histogram, which comprises
The dividing module is used for dividing the shot picture into blocks according to grids;
preferably, for the judgment of the subsequent bright blocks of the quota, the whole frame can be divided into 255 small blocks.
The current storage module is used for storing the histogram statistical information of the current shot picture as original histogram statistical information and then transferring the original histogram statistical information to the judgment module;
the judging module comprises a bright spot judging submodule and a bright block judging submodule and then transfers to the comparing module;
the bright spot discriminating submodule includes:
the bright point judging unit is used for judging whether pixel points in the histogram statistical information of the current shot picture are bright points according to the first threshold value and then switching to the bright point statistical unit;
the bright spot counting unit is used for counting the number of the bright spots;
in one mode, the bright spots may be determined based on 256 pieces of histogram statistical information, and the number of bright spots in the statistical frame that are greater than a certain threshold is determined as the bright spots.
The bright block discrimination submodule includes:
the bright block judging unit judges whether the block of the current shot picture is a bright block according to a second threshold value and then transfers the block to the bright block counting unit;
a bright block counting unit for counting the number of bright blocks;
the method is characterized in that the bright spot is utilized, the second available characteristic is the bright block, and then 255 blocks divided in the previous example are scanned in a circulating manner to count the number of the 255 blocks belonging to the bright block.
The comparison module is used for comparing the number of the bright spots with a third threshold value and the number of the bright blocks with a fourth threshold value, if the number of the bright spots exceeds the third threshold value and the number of the bright blocks exceeds the fourth threshold value, the adjustment module is switched to, if the number of the bright spots is smaller than the third threshold value and the number of the bright blocks is smaller than the fourth threshold value, the callback module is switched to, and if the number of the bright spots is equal to the third threshold value and the number of the bright blocks is equal to the fourth threshold value, the current storage module is switched;
only when the bright block and the bright spot in the picture reach a certain threshold value, whether the block belongs to the bright block or not is judged, and the bright spot and the bright block both reach the threshold value, the picture is judged to be a highlight scene, so that the subsequent highlight inhibition is started.
The adjusting module is used for adjusting the exposure value of the camera and then switching back to the judging module;
when the scene is judged to be a strong light scene, the module starts to carry out strong light inhibition by adjusting the exposure value of the camera.
And the callback module is used for calling back the exposure value of the camera and then transferring the exposure value back to the current storage module.
In conclusion, the histogram-based statistical information provided by the invention can automatically identify and inhibit the strong light in the camera shooting picture, can effectively inhibit the scene application such as the strong light of the car lamp in the shooting process of the camera, and can clearly expose other information except the strong light, such as the license plate. In addition, under the condition that the strong light disappears, the camera picture can be automatically detected and restored to a normal scene, so that the accuracy of capturing and identifying the picture attention information under the condition of accidental strong light can be greatly improved, and the normal use of the camera is not influenced.
The technology of the invention is suitable for inhibiting the situation of accidental strong light in the shooting process of various cameras, and is particularly suitable for identifying the license plate of a vehicle under the strong light of the vehicle lamp shot by the camera. In addition, in order to better capture and identify the license plate, in the process of suppressing the strong light of the car lamp, the image enhancement technology is utilized to enhance the license plate effect, so that the recognition of license plate characters by a camera is facilitated, the license plate image enhancement mainly adopts the histogram equalization technology, the license plate part can be well promoted by utilizing the technology, and meanwhile, part of car lamp halation can be suppressed.
The mode one mainly realizes two kinds of functions, first be exactly when the car light appears, can restrain the car light, make the license plate show out, the second is exactly when the car light disappears, the picture can revert to normal condition, and the suppression intensity of car light still can be according to how much automatically regulated of car light, also be when the car light is less in the picture, the suppression of car light is weak, and when a plurality of car lights appear in the picture, the suppression of car light just will be some more strong this moment, and the car light suppression intensity can also be according to the difference of scene, the individual difference of liking of customer, the suppression intensity of autonomic selection car light.
If necessary, a day and night switching module can be added in front of the current storage module and used for judging whether the current shooting scene is in a day state or a night state, and a third threshold value and a fourth threshold value are correspondingly set in the day state or the night state.
The purpose of adding this step is to distinguish the scenes of day and night at the beginning of the inhibition, because in the day, when the sunlight is abnormally strong, the picture is captured from the camera, the recognition degree of the license plate is not very high, so that the day and the night are distinguished. The distinction between the day and the night is mainly judged by using the gain of the camera and the information of the dark points and the dark blocks, when the gain, the dark points and the dark blocks exceed a certain range, the current scene is judged to be in a night state, the day and the night are separated for processing, the processing methods of the day and the night are approximately the same, and only the third threshold and the fourth threshold are different.
Example 8
In the adjusting module, the exposure value of the camera is adjusted according to the first step length and then is converted back to the judging module; the callback module callbacks the exposure value of the camera according to the second step length and then transfers the exposure value back to the current storage module; the first step length and the second step length dynamically change according to the difference value between the bright point number and the third threshold value and the difference value between the bright block number and the fourth threshold value, and if the difference value is larger, the first step length and the second step length are larger.
Therefore, the current strong light degree is known through the difference value between the bright point number and the third threshold value and the difference value between the bright block number and the fourth threshold value, and the dynamic first step length and the dynamic second step length can be dynamically changed according to the strong light degree to achieve the purpose of fast adjustment for adapting to the strong light environment.
The embodiment dynamically sets the adjustment step length of the exposure target value, namely different step lengths are set according to the strong light degree of the picture, so that the picture can be prevented from flickering, different adjustment step lengths are set by calculating the deviation degree of the current bright point and bright block value and the threshold value, when the deviation degree is large, the adjustment step length is large, the car light inhibition effect is fast, when the deviation degree is small, when the picture is close to an ideal scene, the adjustment step length at the moment is small, and besides the design is in accordance with practical use, the flicker and oscillation of the picture can be prevented.
Example 9
The third threshold and the fourth threshold comprise a plurality of selectable values; the histogram-based camera glare suppression apparatus further includes a threshold selection module for selecting a third threshold and a fourth threshold from a plurality of selectable values.
The setting of the threshold is one of the key points of the patent technology, and if the threshold is set more singly, the threshold can be used, but the characteristic of weak scene adaptability can also occur, namely, a non-highlight scene is possibly judged to be a highlight scene, and the highlight scene is supposed to be a highlight scene, and is judged to be a non-highlight scene.
Example 10
The bright block distinguishing unit comprises one or more of the following subunits:
the first bright block judging subunit is used for judging whether a pixel point in the histogram statistical information of each block of the current shot picture is a bright point or not according to a first threshold value, and counting bright blocks with the number of the bright points exceeding a fifth threshold value;
the second bright block distinguishing subunit is used for carrying out sectional statistics on the histogram statistical information of each block of the current shot picture according to a BIN threshold value to obtain a bright point proportion, and the bright block which exceeds the sixth threshold value is a bright block;
and the third bright block judging subunit is used for counting the overall brightness mean value of the current shot picture, then respectively calculating the deviation degree of each block of the current shot picture from the overall brightness mean value, and regarding the bright blocks with the deviation degree exceeding a seventh threshold value.
Example 11
The bright block determination unit specifically includes:
the array establishing unit is used for setting a two-dimensional array corresponding to the shot picture divided into blocks according to grids, the initialization number of the two-dimensional array is 0, and then the two-dimensional array is transferred to the bright block judging unit;
the bright block judging unit is used for judging whether the block of the current shot picture is a bright block according to a second threshold value and then switching to the bright block counting unit;
the bright block counting unit is used for counting the number of bright blocks, correspondingly judging the bright block position in the two-dimensional array to be 1, and then switching to the array counting unit;
the array counting unit is used for counting the number of the adjacent bright blocks of each bright block to be 1 and then switching to the threshold value adjusting unit;
and the threshold adjusting unit is used for reducing the third threshold and the fourth threshold when the number of the 1 in the two-bit array exceeds the eighth threshold, and otherwise, increasing the third threshold and the fourth threshold.
The technical scheme of the embodiment is that a set of intelligent brightness suppression adjustment is designed by utilizing a connected domain thought in order to match subjective feelings of people. The principle is to utilize the connected domain of the bright block to self-adaptively adjust the threshold of the bright block. From the subjective feeling of people, when the bright blocks of the picture are different in dispersion and concentration, the definition of the license plate and the subjective feeling of people are different, when the bright blocks are more dispersed, the strong light inhibition degree is weaker, and when the bright blocks of the picture are more concentrated, the inhibition strength of the vehicle lamp is stronger. The judgment threshold of the bright block is set differently according to the dispersion and concentration degree of the bright block, when the bright block of the picture is counted, a two-dimensional array corresponding to 255 blocks is set, the array is 0 when initialized, when the block is judged to be the bright block, the position of the corresponding two-dimensional array is assigned to be 1, after the 255 blocks are scanned, the concentration degree of the bright block is judged by counting 8 neighborhoods of each block and looking at the number of the median value of the 8 neighborhoods to be 1, and when the concentration degree is higher, the inhibition degree of the car lamp at the moment is correspondingly stronger and conversely is weaker.
In order to better adapt to different scenes, the invention also provides another mode of a highlight (particularly car lamp highlight) suppression strategy, when the camera is installed at a doorway of a cell or an underground parking lot, when a car lamp appears, the highlight is mainly distributed at a specific position in a picture and is similar to a scene that the camera looks outdoors from indoors, so the design adapts to the scene of the cell or the underground parking lot by utilizing the wide dynamic function of the camera, namely, when the car lamp appears, the wide dynamic function of the camera is turned on, and when the car lamp disappears, the wide dynamic function of the camera is turned off, and because the whole picture has a frosting phenomenon if the wide dynamic function is turned on in a normal scene, the wide dynamic function is turned off in the normal scene.
And a second mode: the aim of restraining the car lamp is achieved mainly by controlling the wide dynamic switch of the camera.
The invention further provides a histogram-based camera glare suppression apparatus, comprising the steps of,
the dividing module is used for dividing the shot picture into blocks according to grids;
preferably, for the judgment of the subsequent bright blocks of the quota, the whole frame can be divided into 255 small blocks.
The current storage module is used for storing the histogram statistical information of the current shot picture as original histogram statistical information and then transferring the original histogram statistical information to the judgment module;
the judging module comprises a bright spot judging submodule and a bright block judging submodule and then transfers to the comparing module;
the bright spot discriminating submodule includes:
the bright point judging unit is used for judging whether pixel points in the histogram statistical information of the current shot picture are bright points according to the first threshold value and then switching to the bright point statistical unit;
in one mode, the bright spots may be determined based on 256 pieces of histogram statistical information, and the number of bright spots in the statistical frame that are greater than a certain threshold is determined as the bright spots.
The bright spot counting unit is used for counting the number of the bright spots;
the bright block discrimination submodule includes:
the bright block judging unit judges whether the block of the current shot picture is a bright block according to a second threshold value and then transfers the block to the bright block counting unit;
a bright block counting unit for counting the number of bright blocks;
the method is characterized in that the bright spot is utilized, the second available characteristic is the bright block, and then 255 blocks divided in the previous example are scanned in a circulating manner to count the number of the 255 blocks belonging to the bright block.
The comparison module is used for comparing the number of the bright spots with a third threshold value and the number of the bright blocks with a fourth threshold value, if the number of the bright spots exceeds the third threshold value and the number of the bright blocks exceeds the fourth threshold value, the adjustment module is switched to, if the number of the bright spots is smaller than the third threshold value and the number of the bright blocks is smaller than the fourth threshold value, the callback module is switched to, and if the number of the bright spots is equal to the third threshold value and the number of the bright blocks is equal to the fourth threshold value, the current storage module is switched;
the adjusting module is used for switching the camera to enter a wide dynamic mode and then switching back to the judging module;
when the scene is judged to be a strong light scene, the step starts to carry out strong light inhibition by adjusting the exposure value of the camera.
And the call-back module is used for switching the camera to enter a common mode and then switching back to the current storage module.
In conclusion, the histogram-based statistical information provided by the invention can automatically identify and inhibit the strong light in the camera shooting picture, can effectively inhibit the scene application such as the strong light of the car lamp in the shooting process of the camera, and can clearly expose other information except the strong light, such as the license plate. In addition, under the condition that the strong light disappears, the camera picture can be automatically detected and restored to a normal scene, so that the accuracy of capturing and identifying the picture attention information under the condition of accidental strong light can be greatly improved, and the normal use of the camera is not influenced.
The technology of the invention is suitable for inhibiting the situation of accidental strong light in the shooting process of various cameras, and is particularly suitable for identifying the license plate of a vehicle under the strong light of the vehicle lamp shot by the camera. In addition, in order to better capture and identify the license plate, in the process of suppressing the strong light of the car lamp, the image enhancement technology is utilized to enhance the license plate effect, so that the recognition of license plate characters by a camera is facilitated, the license plate image enhancement mainly adopts the histogram equalization technology, the license plate part can be well promoted by utilizing the technology, and meanwhile, part of car lamp halation can be suppressed.
If necessary, a day and night switching module can be added in front of the current storage module and used for judging whether the current shooting scene is in a day state or a night state, and a third threshold value and a fourth threshold value are correspondingly set in the day state or the night state.
The purpose of adding this step is to distinguish the scenes of day and night at the beginning of the inhibition, because in the day, when the sunlight is abnormally strong, the picture is captured from the camera, the recognition degree of the license plate is not very high, so that the day and the night are distinguished. The distinction between the day and the night is mainly judged by using the gain of the camera and the information of the dark points and the dark blocks, when the gain, the dark points and the dark blocks exceed a certain range, the current scene is judged to be in a night state, the day and the night are separated for processing, the processing methods of the day and the night are approximately the same, and only the third threshold and the fourth threshold are different.
Example 12
In the adjusting module, the exposure value of the camera is adjusted according to the first step length and then is converted back to the judging module; the callback module callbacks the exposure value of the camera according to the second step length and then transfers the exposure value back to the current storage module; the first step length and the second step length dynamically change according to the difference value between the bright point number and the third threshold value and the difference value between the bright block number and the fourth threshold value, and if the difference value is larger, the first step length and the second step length are larger.
Therefore, the current strong light degree is known through the difference value between the bright point number and the third threshold value and the difference value between the bright block number and the fourth threshold value, and the dynamic first step length and the dynamic second step length can be dynamically changed according to the strong light degree to achieve the purpose of fast adjustment for adapting to the strong light environment.
The embodiment dynamically sets the adjustment step length of the exposure target value, namely different step lengths are set according to the strong light degree of the picture, so that the picture can be prevented from flickering, different adjustment step lengths are set by calculating the deviation degree of the current bright point and bright block value and the threshold value, when the deviation degree is large, the adjustment step length is large, the car light inhibition effect is fast, when the deviation degree is small, when the picture is close to an ideal scene, the adjustment step length at the moment is small, and besides the design is in accordance with practical use, the flicker and oscillation of the picture can be prevented.
Example 13
The third threshold and the fourth threshold comprise a plurality of selectable values; the histogram-based camera glare suppression apparatus further includes a threshold selection module for selecting a third threshold and a fourth threshold from a plurality of selectable values.
The setting of the threshold is one of the key points of the patent technology, and if the threshold is set more singly, the threshold can be used, but the characteristic of weak scene adaptability can also occur, namely, a non-highlight scene is possibly judged to be a highlight scene, and the highlight scene is supposed to be a highlight scene, and is judged to be a non-highlight scene.
Example 14
The bright block distinguishing unit comprises one or more of the following subunits:
the first bright block judging subunit is used for judging whether a pixel point in the histogram statistical information of each block of the current shot picture is a bright point or not according to a first threshold value, and counting bright blocks with the number of the bright points exceeding a fifth threshold value;
the second bright block distinguishing subunit is used for carrying out sectional statistics on the histogram statistical information of each block of the current shot picture according to a BIN threshold value to obtain a bright point proportion, and the bright block which exceeds the sixth threshold value is a bright block;
and the third bright block judging subunit is used for counting the overall brightness mean value of the current shot picture, then respectively calculating the deviation degree of each block of the current shot picture from the overall brightness mean value, and regarding the bright blocks with the deviation degree exceeding a seventh threshold value.
Example 15
The bright block determination unit specifically includes:
the array establishing unit is used for setting a two-dimensional array corresponding to the shot picture divided into blocks according to grids, the initialization number of the two-dimensional array is 0, and then the two-dimensional array is transferred to the bright block judging unit;
the bright block judging unit is used for judging whether the block of the current shot picture is a bright block according to a second threshold value and then switching to the bright block counting unit;
the bright block counting unit is used for counting the number of bright blocks, correspondingly judging the bright block position in the two-dimensional array to be 1, and then switching to the array counting unit;
the array counting unit is used for counting the number of the adjacent bright blocks of each bright block to be 1 and then switching to the threshold value adjusting unit;
and the threshold adjusting unit is used for reducing the third threshold and the fourth threshold when the number of the 1 in the two-bit array exceeds the eighth threshold, and otherwise, increasing the third threshold and the fourth threshold.
The technical scheme of the embodiment is that a set of intelligent brightness suppression adjustment is designed by utilizing a connected domain thought in order to match subjective feelings of people. The principle is to utilize the connected domain of the bright block to self-adaptively adjust the threshold of the bright block. From the subjective feeling of people, when the bright blocks of the picture are different in dispersion and concentration, the definition of the license plate and the subjective feeling of people are different, when the bright blocks are more dispersed, the strong light inhibition degree is weaker, and when the bright blocks of the picture are more concentrated, the inhibition strength of the vehicle lamp is stronger. The judgment threshold of the bright block is set differently according to the dispersion and concentration degree of the bright block, when the bright block of the picture is counted, a two-dimensional array corresponding to 255 blocks is set, the array is 0 when initialized, when the block is judged to be the bright block, the position of the corresponding two-dimensional array is assigned to be 1, after the 255 blocks are scanned, the concentration degree of the bright block is judged by counting 8 neighborhoods of each block and looking at the number of the median value of the 8 neighborhoods to be 1, and when the concentration degree is higher, the inhibition degree of the car lamp at the moment is correspondingly stronger and conversely is weaker.
The above description is only an example of the present invention and does not limit the scope of the present invention, for example, the first and second … … in the present patent only represent the distinction of their names and do not represent the difference of their importance and location. Therefore, all the equivalent structures or equivalent processes performed by using the contents of the specification and the drawings of the present invention, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A camera strong light inhibition method based on a histogram is characterized in that: comprises the steps of (a) carrying out,
dividing a shot picture into blocks according to grids;
s2) storing the histogram statistical information of the current shot picture as the original histogram statistical information;
s3) executing a bright spot discrimination sub-process, a bright block discrimination sub-process;
the bright point discrimination sub-process includes the steps of:
s311) judging whether the pixel point in the histogram statistical information of the current shooting picture is a bright point or not according to the first threshold;
s312) counting the number of the bright spots;
the bright block judging sub-process comprises the following steps:
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
s4) comparing the number of bright spots with a third threshold, the number of bright blocks with a fourth threshold, continuing with step S5 if the number of bright spots exceeds the third threshold while the number of bright blocks exceeds the fourth threshold, going to step S6 if the number of bright spots is less than the third threshold while the number of bright blocks is less than the fourth threshold, going back to step S2 if the number of bright spots is equal to the third threshold while the number of bright blocks is equal to the fourth threshold;
s5) adjusting the exposure value of the camera, and then returning to step S3;
s6) the exposure value of the camera is recalled, and then, the process returns to step S2.
2. A histogram based camera glare suppression method as defined in claim 1, wherein: in the step S5, the exposure value of the camera is adjusted according to the first step length, and then the process returns to the step S3; in the step S6, the exposure value of the camera is adjusted back according to the second step length, and then the process returns to the step S2, where the first step length and the second step length dynamically change according to the difference between the number of the bright spots and the third threshold value and the difference between the number of the bright spots and the fourth threshold value, and if the difference is larger, the first step length and the second step length are larger.
3. A camera strong light inhibition method based on a histogram is characterized in that: comprises the steps of (a) carrying out,
dividing a shot picture into blocks according to grids;
s2) storing the histogram statistical information of the current shot picture as the original histogram statistical information;
s3) executing a bright spot discrimination sub-process, a bright block discrimination sub-process;
the bright point discrimination sub-process includes the steps of:
s311) judging whether the pixel point in the histogram statistical information of the current shooting picture is a bright point or not according to the first threshold;
s312) counting the number of the bright spots;
the bright block judging sub-process comprises the following steps:
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
s4) comparing the number of bright spots with a third threshold, the number of bright blocks with a fourth threshold, continuing with step S5 if the number of bright spots exceeds the third threshold while the number of bright blocks exceeds the fourth threshold, going to step S6 if the number of bright spots is less than the third threshold while the number of bright blocks is less than the fourth threshold, going back to step S2 if the number of bright spots is equal to the third threshold while the number of bright blocks is equal to the fourth threshold;
s5) switching the camera into the wide dynamic mode, and then returning to step S3;
s6) enters the normal mode, and then returns to step S2.
4. A histogram based camera glare suppression method as defined in claim 3, wherein: the third threshold and the fourth threshold comprise a plurality of selectable values; the histogram-based camera glare suppression method further includes the step of selecting a third threshold value and a fourth threshold value from a plurality of selectable values.
5. A histogram based camera glare suppression method as defined in claim 3, wherein: in step S321, the bright block determination is performed in one or more of the following manners:
1) judging whether a pixel point in the histogram statistical information of each block of the current shot picture is a bright point or not according to the first threshold, and counting whether the number of the bright points exceeds a fifth threshold is a bright block;
2) carrying out sectional statistics on the histogram statistical information of each block of the current shot picture according to a BIN threshold value to obtain a bright spot proportion, wherein the bright spot proportion exceeds a sixth threshold value and is a bright block;
3) and counting the overall brightness mean value of the current shot picture, then respectively calculating the deviation degree of each block of the current shot picture from the overall brightness mean value, and judging whether the deviation degree exceeds a seventh threshold value as a bright block.
6. A histogram based camera glare suppression method as defined in claim 3, wherein: the bright block judging sub-process specifically comprises the following steps:
s320) setting a two-dimensional array corresponding to the shooting picture according to the grid division blocks, wherein the initialization number of the two-dimensional array is 0;
s321) judging whether the block of the current shooting picture is a bright block or not according to the second threshold;
s322) counting the number of the bright blocks;
assigning the position of the corresponding judged bright block in the two-dimensional array as 1;
s323) counting the number of adjacent bright blocks of each bright block as 1;
s324) if the number of the 1 in the two-bit array exceeds the eighth threshold, the third threshold and the fourth threshold are reduced, otherwise, the third threshold and the fourth threshold are increased.
7. A histogram-based camera glare suppression apparatus, characterized by: comprises that
The dividing module is used for dividing the shot picture into blocks according to grids;
the current storage module is used for storing the histogram statistical information of the current shot picture as original histogram statistical information and then transferring the original histogram statistical information to the judgment module;
the judging module comprises a bright spot judging submodule and a bright block judging submodule and then transfers to the comparing module;
the bright spot discriminating submodule includes:
the bright point judging unit is used for judging whether pixel points in the histogram statistical information of the current shot picture are bright points according to the first threshold value and then switching to the bright point statistical unit;
the bright spot counting unit is used for counting the number of the bright spots;
the bright block discrimination submodule includes:
the bright block judging unit judges whether the block of the current shot picture is a bright block according to a second threshold value and then transfers the block to the bright block counting unit;
a bright block counting unit for counting the number of bright blocks;
the comparison module is used for comparing the number of the bright spots with a third threshold value and the number of the bright blocks with a fourth threshold value, if the number of the bright spots exceeds the third threshold value and the number of the bright blocks exceeds the fourth threshold value, the adjustment module is switched to, if the number of the bright spots is smaller than the third threshold value and the number of the bright blocks is smaller than the fourth threshold value, the callback module is switched to, and if the number of the bright spots is equal to the third threshold value and the number of the bright blocks is equal to the fourth threshold value, the current storage module is switched;
the adjusting module is used for adjusting the exposure value of the camera and then switching back to the judging module;
and the callback module is used for calling back the exposure value of the camera and then transferring the exposure value back to the current storage module.
8. The histogram based camera glare suppression apparatus of claim 7, wherein: in the adjusting module, the exposure value of the camera is adjusted according to the first step length and then is converted back to the judging module; the callback module callbacks the exposure value of the camera according to the second step length and then transfers the exposure value back to the current storage module; the first step length and the second step length dynamically change according to the difference value between the bright point number and the third threshold value and the difference value between the bright block number and the fourth threshold value, and if the difference value is larger, the first step length and the second step length are larger.
9. A histogram-based camera glare suppression apparatus, characterized by: comprises that
The dividing module is used for dividing the shot picture into blocks according to grids;
the current storage module is used for storing the histogram statistical information of the current shot picture as original histogram statistical information and then transferring the original histogram statistical information to the judgment module;
the judging module comprises a bright spot judging submodule and a bright block judging submodule and then transfers to the comparing module;
the bright spot discriminating submodule includes:
the bright point judging unit is used for judging whether pixel points in the histogram statistical information of the current shot picture are bright points according to the first threshold value and then switching to the bright point statistical unit;
the bright spot counting unit is used for counting the number of the bright spots;
the bright block discrimination submodule includes:
the bright block judging unit judges whether the block of the current shot picture is a bright block according to a second threshold value and then transfers the block to the bright block counting unit;
a bright block counting unit for counting the number of bright blocks;
the comparison module is used for comparing the number of the bright spots with a third threshold value and the number of the bright blocks with a fourth threshold value, if the number of the bright spots exceeds the third threshold value and the number of the bright blocks exceeds the fourth threshold value, the adjustment module is switched to, if the number of the bright spots is smaller than the third threshold value and the number of the bright blocks is smaller than the fourth threshold value, the callback module is switched to, and if the number of the bright spots is equal to the third threshold value and the number of the bright blocks is equal to the fourth threshold value, the current storage module is switched;
the adjusting module is used for switching the camera to enter a wide dynamic mode and then switching back to the judging module;
and the call-back module is used for switching the camera to enter a common mode and then switching back to the current storage module.
10. A histogram based camera glare suppression apparatus as claimed in any one of claim 9, wherein:
the bright block determination unit specifically includes:
the array establishing unit is used for setting a two-dimensional array corresponding to the shot picture divided into blocks according to grids, the initialization number of the two-dimensional array is 0, and then the two-dimensional array is transferred to the bright block judging unit;
the bright block judging unit is used for judging whether the block of the current shot picture is a bright block according to a second threshold value and then switching to the bright block counting unit;
the bright block counting unit is used for counting the number of bright blocks, correspondingly judging the bright block position in the two-dimensional array to be 1, and then switching to the array counting unit;
the array counting unit is used for counting the number of the adjacent bright blocks of each bright block to be 1 and then switching to the threshold value adjusting unit;
and the threshold adjusting unit is used for reducing the third threshold and the fourth threshold when the number of the 1 in the two-bit array exceeds the eighth threshold, and otherwise, increasing the third threshold and the fourth threshold.
CN201711332525.5A 2017-12-13 2017-12-13 Camera highlight suppression method and device based on histogram Active CN109922274B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711332525.5A CN109922274B (en) 2017-12-13 2017-12-13 Camera highlight suppression method and device based on histogram

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711332525.5A CN109922274B (en) 2017-12-13 2017-12-13 Camera highlight suppression method and device based on histogram

Publications (2)

Publication Number Publication Date
CN109922274A CN109922274A (en) 2019-06-21
CN109922274B true CN109922274B (en) 2021-05-14

Family

ID=66959305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711332525.5A Active CN109922274B (en) 2017-12-13 2017-12-13 Camera highlight suppression method and device based on histogram

Country Status (1)

Country Link
CN (1) CN109922274B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014912A (en) * 2019-12-19 2021-06-22 合肥君正科技有限公司 Method for detecting direct projection of strong light source of monitoring camera in vehicle
CN117835053B (en) * 2024-03-04 2024-06-04 杭州海康威视数字技术股份有限公司 Switching method and device of wide dynamic mode

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11275454A (en) * 1998-03-23 1999-10-08 Ricoh Co Ltd Digital video camera
CN101127835A (en) * 2007-09-27 2008-02-20 中兴通讯股份有限公司 A pre-processing method and device for improving video image quality of digital video camera
KR100839093B1 (en) * 2007-01-31 2008-06-19 한국과학기술원 Method and apparatus for measuring luminance and hue
CN101340523A (en) * 2008-08-14 2009-01-07 北京中星微电子有限公司 Method and apparatus for exposure compensating digital image
CN101783963A (en) * 2010-02-10 2010-07-21 西安理工大学 Nighttime image enhancing method with highlight inhibition
CN102801918A (en) * 2011-05-24 2012-11-28 佳能株式会社 Image pickup apparatus and method of controlling the image pickup apparatus
CN103458194A (en) * 2013-08-28 2013-12-18 中国科学院深圳先进技术研究院 Method and device for analyzing exposure degree of digital image and video and digital imaging system
CN103780845A (en) * 2014-02-28 2014-05-07 金三立视频科技(深圳)有限公司 Method and device for strong light inhibition on basis of non-wide-dynamic function
CN103826066A (en) * 2014-02-26 2014-05-28 芯原微电子(上海)有限公司 Automatic exposure adjusting method and system
CN105554414A (en) * 2015-12-15 2016-05-04 浙江宇视科技有限公司 Strong light inhibition method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11275454A (en) * 1998-03-23 1999-10-08 Ricoh Co Ltd Digital video camera
KR100839093B1 (en) * 2007-01-31 2008-06-19 한국과학기술원 Method and apparatus for measuring luminance and hue
CN101127835A (en) * 2007-09-27 2008-02-20 中兴通讯股份有限公司 A pre-processing method and device for improving video image quality of digital video camera
CN101340523A (en) * 2008-08-14 2009-01-07 北京中星微电子有限公司 Method and apparatus for exposure compensating digital image
CN101783963A (en) * 2010-02-10 2010-07-21 西安理工大学 Nighttime image enhancing method with highlight inhibition
CN102801918A (en) * 2011-05-24 2012-11-28 佳能株式会社 Image pickup apparatus and method of controlling the image pickup apparatus
CN103458194A (en) * 2013-08-28 2013-12-18 中国科学院深圳先进技术研究院 Method and device for analyzing exposure degree of digital image and video and digital imaging system
CN103826066A (en) * 2014-02-26 2014-05-28 芯原微电子(上海)有限公司 Automatic exposure adjusting method and system
CN103780845A (en) * 2014-02-28 2014-05-07 金三立视频科技(深圳)有限公司 Method and device for strong light inhibition on basis of non-wide-dynamic function
CN105554414A (en) * 2015-12-15 2016-05-04 浙江宇视科技有限公司 Strong light inhibition method and device

Also Published As

Publication number Publication date
CN109922274A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
CN110351490B (en) Exposure method, exposure device and image pickup equipment
EP3701712B1 (en) Adaptive infrared illumination for exposure correction
CN101834996B (en) Luminous flux control method of high definition vehicle snapshot system
CN101247480B (en) Automatic exposure method based on objective area in image
CN108206918B (en) Optical compensation method and device
US8035728B2 (en) Method and apparatus providing rule-based auto exposure technique preserving scene dynamic range
CN102326392B (en) Adjusting auto white balance
WO2021109620A1 (en) Exposure parameter adjustment method and apparatus
CN106412447A (en) Exposure control system and method thereof
CN109922274B (en) Camera highlight suppression method and device based on histogram
CN104580925A (en) Image brightness controlling method, device and camera
US9977986B2 (en) Method and apparatus for switching a region of interest
CN103533252A (en) Method and device for automatically switching day and night modes
CN105812674A (en) Signal lamp color correction method, monitoring method, and device thereof
WO2015199969A2 (en) Exposure metering based on background pixels
CN106210553B (en) Snapshot optimization method and device under shadow shielding
CN105827898A (en) Gama curve regulation method and device applied to camera
CN105812677B (en) A kind of image generating method and system
CN105554409B (en) A kind of method and apparatus of change detection round the clock
US11831992B2 (en) Control circuit and control method of image sensor
CN101430830B (en) Imaging control method and apparatus
CN112911160A (en) Image shooting method, device, equipment and storage medium
US11568526B2 (en) Dual sensor imaging system and imaging method thereof
CN112291481B (en) Exposure automatic adjusting method and device, electronic equipment and storage medium
CN114500830A (en) Camera adjusting method and device, electronic equipment and storage medium

Legal Events

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