A camera day and night switching method and system based on regional adaptive threshold

By adopting a camera day and night switching method based on the area adaptive threshold in the monitoring device, the exposure threshold is adaptively adjusted to solve the repeated switching problem of the monitoring device during the day and night mode switching, achieving a more stable mode switching effect.

CN118590752BActive Publication Date: 2024-11-26JINAN HEPU VISION OPTOELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411035273.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-26
Estimated Expiration
2044-07-31

Smart Images

  • Figure CN118590752B_ABST
    Figure CN118590752B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for switching a camera day and night based on a regional adaptive threshold, belonging to the technical field of camera mode switching control, and the method steps are as follows: the camera receives a user-preset exposure threshold for switching from day to night, a night-to-day exposure threshold, and an exposure weight of a monitoring area; the camera's monitoring scene statistical information is acquired in real time, and the actual exposure of the current frame is calculated according to the monitoring scene statistical information; the camera is controlled to switch modes according to the current mode of the camera, the actual exposure of the current frame, and the relationship between the day-to-night exposure threshold and the night-to-day exposure threshold, and the night-to-day exposure threshold is adaptively adjusted before the night mode is switched to the day mode according to the mode relationship of the previous and next frames. The present invention avoids the problem of repeated switching caused by the increase in screen brightness when the fill light is turned on by adaptively adjusting the exposure threshold when the day mode is switched to the night mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of camera mode switching control, and in particular relates to a camera day and night switching method and system based on regional adaptive threshold. Background Art

[0002] With the increase of monitoring demand and the development of monitoring technology, monitoring equipment has been widely used in various fields. Currently, monitoring products are equipped with two modes, day and night, to adapt to different light intensities, especially for low illumination to obtain better image effects. Monitoring products are equipped with fill lights as auxiliary lighting equipment to extend the duration of color effects. Monitoring products have added filters to ensure better light transmittance in night mode.

[0003] Traditionally, the day-night mode switching is achieved by adding hard photosensitivity. This method is relatively stable, but it increases the material cost and is limited by the installation method. Opening holes in the product shell will affect the overall structural strength and waterproof performance of the product. Controlling the day-night mode switching through software thresholds can overcome the hardware installation problem, but this method also has problems. When the ambient brightness decreases and the day mode switches to the night mode, the fill light will turn on, which will cause the screen brightness to increase. The monitoring device will determine that it needs to switch to the day mode and turn off the fill light based on the increased brightness, resulting in repeated mode switching, affecting the normal use of the monitoring device.

[0004] This is a shortcoming of the prior art. Therefore, in view of the above defects in the prior art, it is very necessary to provide a method and system for switching cameras day and night based on regional adaptive thresholds. Summary of the invention

[0005] In view of the fact that the current monitoring equipment in the prior art uses hard photosensitivity for day-night switching, which increases costs and affects the overall performance of the product, and the software threshold switching method has the defect of repeated switching, the present invention provides a camera day-night switching method and system based on regional adaptive thresholds to solve the above technical problems.

[0006] In a first aspect, the present invention provides a method for switching a camera day and night based on a regional adaptive threshold, comprising the following steps:

[0007] S1. The camera receives the user's pre-set daytime switching night exposure threshold, night switching daytime exposure threshold and exposure weight of the monitoring area;

[0008] S2. Obtain the monitoring scene statistical information of the camera in real time, and calculate the actual exposure of the current frame based on the monitoring scene statistical information;

[0009] S3. Control the camera to switch modes according to the current mode of the camera, the actual exposure of the current frame, and the relationship between the exposure threshold for switching from day to night and the exposure threshold for switching from night to day. At the same time, before switching from night mode to day mode, adaptively adjust the exposure threshold for switching from night to day according to the mode relationship between the previous and next frames.

[0010] Furthermore, the specific steps of step S1 are as follows:

[0011] S11. The user pre-sets the exposure threshold for the camera to switch from day to night, and uses it as the first exposure threshold Save in camera;

[0012] S12. The user pre-sets the exposure threshold for the camera to switch from night to day, and uses it as the second exposure threshold Save in camera;

[0013] S13. The user uses the adaptive reduction value of the exposure threshold of the camera switching from night to day as the second exposure adjustment threshold , and pre-set the second exposure adjustment threshold Calculation method of

[0014] S14. The user pre-sets the exposure weight of the monitoring area.

[0015] Furthermore, the specific steps of step S14 are as follows:

[0016] S141. Pre-dividing the monitoring area evenly into rectangular blocks arranged in rows and columns;

[0017] S142. Set the rectangular block combination in the monitoring area in a "convex" shape from bottom to top as the center combination, and set the edge combinations in order from the center combination outward;

[0018] S143. Set the number of "convex" characters in the center combination to M, and M "convex" characters are raised from bottom to top;

[0019] S144. Set the weight of the center combination to be the highest, and the weights of the edge combinations to decrease outward from the center combination;

[0020] S145. Sum the weights of each block as the exposure weight of the monitoring area.

[0021] Furthermore, the specific steps of step S2 are as follows:

[0022] S21. Real-time acquisition of shutter time as monitoring scene statistics of the camera , Gain And the aperture size F;

[0023] S22. Calculate the exposure of the current frame using the following formula: :

[0024]

[0025] in, is the exposure weight of each block in the monitoring area predefined by the user, and q is the number of blocks in the monitoring area.

[0026] Furthermore, the specific steps of step S13 are as follows:

[0027] S131. Obtain the gain in the monitoring scene statistics of the camera ;

[0028] S132. Gain The auxiliary gain is calculated by the following formula :

[0029]

[0030] in, To take the decimal part of the parameter, is the floor rounding function;

[0031] S133. Use the following formula and auxiliary gain Calculate the second exposure adjustment threshold :

[0032]

[0033] Where k is a user-defined adjustment coefficient.

[0034] Furthermore, the specific steps of step S3 are as follows:

[0035] S31. The camera obtains a pre-saved first exposure threshold , the second exposure threshold And the calculated exposure of the current frame ;

[0036] S32. The camera determines the current working mode;

[0037] When it is night mode, go to step S34;

[0038] When it is day mode, go to step S33;

[0039] S33. The camera recognizes the current frame exposure Greater than the first exposure threshold When , the control switches the day mode to the night mode, turns on the fill light, and returns to step S21;

[0040] S34. Whether the camera is in day mode in the previous frame of the current frame, and the exposure of the current frame Less than the second exposure threshold , the second exposure threshold Reduce to the second exposure adjustment threshold , and the exposure value in the current frame Less than the second exposure adjustment threshold , control the switching of night mode to day mode, and when the N frames before the current frame are continuously in night mode, adjust the second exposure value threshold Increase to the second exposure threshold .

[0041] Furthermore, the specific steps of step S34 are as follows:

[0042] S341. The camera determines whether the previous frame of the current frame is in day mode;

[0043] If yes, go to step S342;

[0044] If not, proceed to step S346;

[0045] S342. The camera determines the exposure of the current frame Is it less than the second exposure threshold? ;

[0046] If yes, go to step S343;

[0047] If not, proceed to step S348;

[0048] S343. The second exposure threshold Reduce to the second exposure adjustment threshold ;

[0049] S344. Determine the exposure of the current frame Is it less than the second exposure adjustment threshold? ;

[0050] If yes, go to step S345;

[0051] If not, return to step S21;

[0052] S345. The camera controls the night mode to the day mode, and returns to step S21;

[0053] S346. The camera determines whether the N frames before the current frame are in night mode, where N>1 is a value preset by the user;

[0054] If yes, go to step S347;

[0055] If not, proceed to step S348;

[0056] S347. The camera adjusts the second exposure threshold Increase to the second exposure threshold , return to step S21;

[0057] S348. Camera control maintains the second exposure threshold No change, return to step S21.

[0058] Furthermore, in step S347, the second exposure adjustment threshold is Increase to the second exposure threshold The process is controlled by the following formula:

[0059]

[0060] Where j is the user-defined adjustment speed coefficient.

[0061] In a second aspect, the present invention provides a camera day and night switching system based on regional adaptive threshold, comprising:

[0062] A user setting module is used to receive the exposure threshold for switching from day to night, the exposure threshold for switching from night to day, and the exposure weight of the monitoring area preset by the user;

[0063] The data acquisition module is used to obtain the monitoring scene statistical information of the camera in real time and calculate the actual exposure of the current frame based on the monitoring scene statistical information;

[0064] The mode switching control module is used to control the camera to switch modes according to the current mode, the actual exposure of the current frame and the relationship between the exposure threshold for switching from day to night and the exposure threshold for switching from night to day. At the same time, before switching from night mode to day mode, the exposure threshold for switching from night to day is adaptively adjusted according to the mode relationship between the previous and next frames.

[0065] Furthermore, the user setting module includes:

[0066] The daytime switching night threshold setting unit is used to receive the user's preset camera daytime switching night exposure threshold and use it as the first exposure threshold Save in camera;

[0067] The night-to-day switching threshold setting unit is used to receive the user's preset camera night-to-day exposure threshold and use it as the second exposure threshold Save in camera;

[0068] The night-to-day adjustment threshold setting unit is used to receive the user's adaptive reduction value of the camera's night-to-day exposure threshold as the second exposure adjustment threshold , and pre-set the second exposure adjustment threshold Calculation method of

[0069] The monitoring area division and regional exposure weight calculation unit is used for the user to divide the monitoring area into blocks in advance, and set the weight of each block in the entire monitoring area in a "convex" shape, wherein the weight of the block inside the "convex" shape is greater than the weight of the block outside the "convex" shape, and then the weight of each block is used as the exposure weight of the area;

[0070] The data acquisition module includes:

[0071] A monitoring scene statistical information acquisition unit is used to acquire the shutter time of the monitoring scene statistical information of the camera in real time , Gain And the aperture size F;

[0072] The current frame exposure calculation unit is used to calculate the exposure of the current frame using the following formula: :

[0073]

[0074] in, The exposure weight of each block in the monitoring area is predefined by the user, and q is the number of blocks in the monitoring area;

[0075] The mode switching control module includes:

[0076] A threshold value acquisition unit, used to acquire a pre-saved first exposure threshold value , the second exposure threshold And the calculated exposure of the current frame ;

[0077] A mode determination unit, used to determine the current working mode;

[0078] Day and night switching control unit, used to identify the current frame exposure in day mode Greater than the first exposure threshold When the control switches the day mode to the night mode, and turns on the fill light;

[0079] Night-day switching control unit, used to check whether the previous frame of the current frame was in day mode in night mode, and the exposure of the current frame Less than the second exposure threshold , the second exposure threshold Reduce to the second exposure adjustment threshold , and the exposure value in the current frame Less than the second exposure adjustment threshold , control the switching of night mode to day mode, and when the N frames before the current frame are continuously in night mode, adjust the second exposure value threshold Increase to the second exposure threshold .

[0080] The beneficial effects of the present invention are:

[0081] The camera day / night switching method and system based on regional adaptive threshold provided by the present invention avoids the problem of repeated switching caused by increased picture brightness when the fill light is turned on by adaptively adjusting the exposure threshold when switching from day mode to night mode.

[0082] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect.

[0083] It can be seen that compared with the prior art, the present invention has outstanding substantive features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0085] Figure 1 The figure is a flow chart of an embodiment of a method for switching cameras day and night based on regional adaptive thresholds according to the present invention.

[0086] Figure 2 It is a flow chart of another embodiment of the method for switching cameras day and night based on regional adaptive thresholds of the present invention.

[0087] Figure 3 It is a flow chart of the present invention for adaptively adjusting the exposure threshold for switching from night to day.

[0088] Figure 4 It is a schematic diagram of a camera day and night switching system based on regional adaptive thresholds according to the present invention.

[0089] Figure 5 It is a schematic diagram of the "convex"-shaped monitoring area of ​​the present invention. DETAILED DESCRIPTION

[0090] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0091] See also Figure 1 The figure shows a method for switching cameras day and night based on a regional adaptive threshold in a specific implementation, comprising the following steps:

[0092] S1. The camera receives the user's pre-set daytime switching night exposure threshold, night switching daytime exposure threshold and exposure weight of the monitoring area;

[0093] S2. Obtain the monitoring scene statistical information of the camera in real time, and calculate the actual exposure of the current frame based on the monitoring scene statistical information;

[0094] S3. Control the camera to switch modes according to the current mode of the camera, the actual exposure of the current frame, and the relationship between the exposure threshold for switching from day to night and the exposure threshold for switching from night to day. At the same time, before switching from night mode to day mode, adaptively adjust the exposure threshold for switching from night to day according to the mode relationship between the previous and next frames.

[0095] In this embodiment, Figure 2 As shown, the specific steps of step S1 are as follows:

[0096] S11. The user pre-sets the exposure threshold for the camera to switch from day to night, and uses it as the first exposure threshold Save in camera;

[0097] S12. The user pre-sets the exposure threshold for the camera to switch from night to day, and uses it as the second exposure threshold Save in camera;

[0098] S13. The user uses the adaptive reduction value of the exposure threshold of the camera switching from night to day as the second exposure adjustment threshold , and pre-set the second exposure adjustment threshold Calculation method of

[0099] S14. The user sets the exposure weight of the monitoring area; Figure 5 As shown, the specific steps of step S14 are as follows:

[0100] S141. Pre-dividing the monitoring area evenly into rectangular blocks arranged in rows and columns;

[0101] S142. Set the rectangular block combination in the monitoring area in a "convex" shape from bottom to top as the center combination, and set the edge combinations in order from the center combination outward;

[0102] S143. Set the number of "convex" characters in the center combination to M, and M "convex" characters are raised from bottom to top;

[0103] S144. Set the weight of the center combination to be the highest, and the weights of the edge combinations to decrease outward from the center combination;

[0104] S145. Sum the weights of each block as the exposure weight of the monitoring area;

[0105] It should be noted that the role of regional weight division is to improve the day-night switching anomaly caused by limitations on installation sites and methods. For the inevitable large-area always-on light sources in the picture, such as street lamps and billboards, the switching anomaly problem can be solved by reducing the weight of the block where they are located;

[0106] The specific steps of step S2 are as follows:

[0107] S21. Real-time acquisition of shutter time as monitoring scene statistics of the camera , Gain And the aperture size F; the default value of the aperture size F is 1;

[0108] S22. Calculate the exposure of the current frame using the following formula: :

[0109]

[0110] in, The exposure weight of each block in the monitoring area is predefined by the user, and q is the number of blocks in the monitoring area;

[0111] The specific steps of step S3 are as follows:

[0112] S31. The camera obtains a pre-saved first exposure threshold , the second exposure threshold And the calculated exposure of the current frame ;

[0113] S32. The camera determines the current working mode;

[0114] When it is night mode, go to step S34;

[0115] When it is day mode, go to step S33;

[0116] S33. The camera recognizes the current frame exposure Greater than the first exposure threshold When , the control switches the day mode to the night mode, turns on the fill light, and returns to step S21;

[0117] S34. Whether the camera is in day mode in the previous frame of the current frame, and the exposure of the current frame Less than the second exposure threshold , the second exposure threshold Reduce to the second exposure adjustment threshold , and the exposure value in the current frame Less than the second exposure adjustment threshold , control the switching of night mode to day mode, and when the N frames before the current frame are continuously in night mode, adjust the second exposure value threshold Increase to the second exposure threshold ;like Figure 3 As shown, the specific steps of step S34 are as follows:

[0118] S341. The camera determines whether the previous frame of the current frame is in day mode;

[0119] If yes, go to step S342;

[0120] If not, proceed to step S346;

[0121] S342. The camera determines the exposure of the current frame Is it less than the second exposure threshold? ;

[0122] If yes, go to step S343;

[0123] If not, proceed to step S348;

[0124] S343. The second exposure threshold Reduce to the second exposure adjustment threshold ;

[0125] S344. Determine the exposure of the current frame Is it less than the second exposure adjustment threshold? ;

[0126] If yes, go to step S345;

[0127] If not, return to step S21;

[0128] S345. The camera controls the night mode to the day mode, and returns to step S21;

[0129] S346. The camera determines whether the N frames before the current frame are in night mode, where N>1 is a value preset by the user; for example, N may be 3;

[0130] If yes, go to step S347;

[0131] If not, proceed to step S348;

[0132] S347. The camera adjusts the second exposure threshold Increase to the second exposure threshold , return to step S21;

[0133] S348. Camera control maintains the second exposure threshold No change, return to step S21;

[0134] It should be noted that the specific steps of step S13 are as follows:

[0135] S131. Obtain the gain in the monitoring scene statistics of the camera ;

[0136] S132. Gain The auxiliary gain is calculated by the following formula :

[0137]

[0138] in, To take the decimal part of the parameter, is the floor rounding function;

[0139] S133. Use the following formula and auxiliary gain Calculate the second exposure adjustment threshold :

[0140]

[0141] Among them, k is a user-defined adjustment coefficient, and the default value of k can be 1;

[0142] In step S347, the second exposure adjustment threshold is set Increase to the second exposure threshold The process is controlled by the following formula:

[0143]

[0144] Among them, j is the user-defined adjustment speed coefficient; a colon expression is used here, for example, A?B:C is a colon expression, which means that when condition A is true, expression B is executed, and when condition A is false, expression C is executed.

[0145] It should be understood that the order of execution of the steps in the above embodiment does not mean that the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0146] The following is an embodiment of a camera day / night switching system based on a regional adaptive threshold provided in an embodiment of the present disclosure. This system and the camera day / night switching method based on a regional adaptive threshold in the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the camera day / night switching system based on a regional adaptive threshold, reference can be made to the embodiment of the camera day / night switching method based on a regional adaptive threshold in the above-mentioned embodiments.

[0147] like Figure 4 As shown, the system includes:

[0148] A user setting module is used to receive the exposure threshold for switching from day to night, the exposure threshold for switching from night to day, and the exposure weight of the monitoring area preset by the user;

[0149] The data acquisition module is used to obtain the monitoring scene statistical information of the camera in real time and calculate the actual exposure of the current frame based on the monitoring scene statistical information;

[0150] The mode switching control module is used to control the camera to switch modes according to the current mode, the actual exposure of the current frame and the relationship between the exposure threshold for switching from day to night and the exposure threshold for switching from night to day. At the same time, before switching from night mode to day mode, the exposure threshold for switching from night to day is adaptively adjusted according to the mode relationship between the previous and next frames.

[0151] In this embodiment, the user setting module includes:

[0152] The daytime switching night threshold setting unit is used to receive the user's preset camera daytime switching night exposure threshold and use it as the first exposure threshold Save in camera;

[0153] The night-to-day switching threshold setting unit is used to receive the user's preset camera night-to-day exposure threshold and use it as the second exposure threshold Save in camera;

[0154] The night-to-day adjustment threshold setting unit is used to receive the user's adaptive reduction value of the camera's night-to-day exposure threshold as the second exposure adjustment threshold , and pre-set the second exposure adjustment threshold Calculation method of

[0155] Monitoring area division and regional exposure weight calculation unit, used for users to pre-set the exposure weight of the monitoring area;

[0156] The data acquisition module includes:

[0157] A monitoring scene statistical information acquisition unit is used to acquire the shutter time of the monitoring scene statistical information of the camera in real time , Gain And the aperture size F;

[0158] The current frame exposure calculation unit is used to calculate the exposure of the current frame using the following formula: :

[0159]

[0160] in, The exposure weight of each block in the monitoring area is predefined by the user, and q is the number of blocks in the monitoring area;

[0161] The mode switching control module includes:

[0162] A threshold value acquisition unit, used to acquire a pre-saved first exposure threshold value , the second exposure threshold And the calculated exposure of the current frame ;

[0163] A mode determination unit, used to determine the current working mode;

[0164] Day and night switching control unit, used to identify the current frame exposure in day mode Greater than the first exposure threshold When the control switches the day mode to the night mode, and turns on the fill light;

[0165] Night-day switching control unit, used to check whether the previous frame of the current frame was in day mode in night mode, and the exposure of the current frame Less than the second exposure threshold , the second exposure threshold Reduce to the second exposure adjustment threshold , and the exposure value in the current frame Less than the second exposure adjustment threshold , control the switching of night mode to day mode, and when the N frames before the current frame are continuously in night mode, adjust the second exposure value threshold Increase to the second exposure threshold .

[0166] Although the present invention has been described in detail with reference to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention.

Claims

1. A camera day and night switching method based on regional adaptive threshold, characterized in that: The steps include: S1. The camera receives the exposure threshold for switching from day to night, the exposure threshold for switching from night to day, and the exposure weight of the monitoring area preset by the user; step S1 includes the following steps: S11. The user pre-sets the exposure threshold for the camera to switch from day to night, and uses it as the first exposure threshold Save in camera; S12. The user pre-sets the exposure threshold for the camera to switch from night to day, and uses it as the second exposure threshold Save in camera; S13. The user uses the adaptive reduction value of the exposure threshold of the camera switching from night to day as the second exposure adjustment threshold , and pre-set the second exposure adjustment threshold The specific steps of step S13 are as follows: S131. Obtain the gain in the monitoring scene statistics of the camera ; S132. Gain The auxiliary gain is calculated by the following formula : in, To take the decimal part of the parameter, is the floor rounding function; S133. Use the following formula and auxiliary gain Calculate the second exposure adjustment threshold : Among them, k is the user-defined adjustment coefficient, , and F are the shutter time, gain and aperture size of the camera’s monitoring scene statistics, The exposure weight of each block in the monitoring area is predefined by the user, and q is the number of blocks in the monitoring area; S2. Obtain the monitoring scene statistical information of the camera in real time, and calculate the actual exposure of the current frame based on the monitoring scene statistical information; the specific steps of step S2 are as follows: S21. Real-time acquisition of shutter time as monitoring scene statistics of the camera , Gain And the aperture size F; S22. Calculate the exposure of the current frame using the following formula: : in, The exposure weight of each block in the monitoring area is predefined by the user, and q is the number of blocks in the monitoring area; S3. Control the camera to switch modes according to the current mode of the camera, the actual exposure of the current frame, the exposure threshold for switching from day to night, and the exposure threshold for switching from night to day, and adaptively adjust the exposure threshold for switching from night to day according to the mode relationship of the previous and next frames before switching from night mode to day mode; the specific steps of step S3 are as follows: S31. The camera obtains a pre-saved first exposure threshold , the second exposure threshold And the calculated exposure of the current frame ; S32. The camera determines the current working mode; When it is night mode, go to step S34; When it is day mode, go to step S33; S33. The camera recognizes the current frame exposure Greater than the first exposure threshold When , the control switches the day mode to the night mode, turns on the fill light, and returns to step S21; S34. Whether the camera is in day mode in the previous frame of the current frame, and the exposure of the current frame Less than the second exposure threshold , the second exposure threshold Reduce to the second exposure adjustment threshold , and the exposure value in the current frame Less than the second exposure adjustment threshold , control the switching of night mode to day mode, and when the N frames before the current frame are continuously in night mode, adjust the second exposure value threshold Increase to the second exposure threshold ; The specific steps of step S34 are as follows: S341. The camera determines whether the previous frame of the current frame is in day mode; If yes, go to step S342; If not, proceed to step S346; S342. The camera determines the exposure of the current frame Is it less than the second exposure threshold? ; If yes, go to step S343; If not, proceed to step S348; S343. The second exposure threshold Reduce to the second exposure adjustment threshold ; S344. Determine the exposure of the current frame Is it less than the second exposure adjustment threshold? ; If yes, go to step S345; If not, return to step S21; S345. The camera controls the night mode to the day mode, and returns to step S21; S346. The camera determines whether the N frames before the current frame are in night mode, where N>1 is a value preset by the user; If yes, go to step S347; If not, proceed to step S348; S347. The camera adjusts the second exposure threshold Increase to the second exposure threshold , return to step S21; S348. Camera control maintains the second exposure threshold No change, return to step S21; In step S347, the second exposure adjustment threshold is set Increase to the second exposure threshold The process is controlled by the following formula: Where j is the user-defined adjustment speed coefficient.

2. The camera day and night switching method based on regional adaptive threshold according to claim 1, characterized in that: Step S1 also includes the following steps: S14. The user pre-sets the exposure weight of the monitoring area.

3. The camera day and night switching method based on regional adaptive threshold as claimed in claim 2, characterized in that: The specific steps of step S14 are as follows: S141. Pre-dividing the monitoring area evenly into rectangular blocks arranged in rows and columns; S142. The rectangular block combination in the monitoring area that is "convex" from bottom to top is set as the center combination, and the edge combination is set outward along the center combination; S143. Set the number of "convex" fonts in the center combination to M, M "convex" fonts convex from bottom to top; S144. Set the weight of the center combination to be the highest, and the weights of the edge combinations to decrease outward from the center combination; S145. Sum the weights of each block as the exposure weight of the monitoring area.

4. A system for implementing the camera day and night switching method based on regional adaptive threshold as described in any one of claims 1 to 3, characterized in that: include: A user setting module is used to receive the exposure threshold for switching from day to night, the exposure threshold for switching from night to day, and the exposure weight of the monitoring area preset by the user; The data acquisition module is used to obtain the monitoring scene statistical information of the camera in real time and calculate the actual exposure of the current frame based on the monitoring scene statistical information; The mode switching control module is used to control the camera to switch modes according to the current mode, the actual exposure of the current frame and the relationship between the exposure threshold for switching from day to night and the exposure threshold for switching from night to day. At the same time, before switching from night mode to day mode, the exposure threshold for switching from night to day is adaptively adjusted according to the mode relationship between the previous and next frames.

5. The system according to claim 4, characterized in that The user settings module includes: The daytime switching night threshold setting unit is used to receive the user's preset camera daytime switching night exposure threshold and use it as the first exposure threshold Save in camera; The night-to-day switching threshold setting unit is used to receive the user's preset camera night-to-day exposure threshold and use it as the second exposure threshold Save in camera; The night-to-day adjustment threshold setting unit is used to receive the user's adaptive reduction value of the camera's night-to-day exposure threshold as the second exposure adjustment threshold , and pre-set the second exposure adjustment threshold Calculation method of Monitoring area division and regional exposure weight calculation unit, used for users to pre-set the exposure weight of the monitoring area; The data acquisition module includes: A monitoring scene statistical information acquisition unit is used to acquire the shutter time of the monitoring scene statistical information of the camera in real time , Gain And the aperture size F; The current frame exposure calculation unit is used to calculate the exposure of the current frame using the following formula: : in, The exposure weight of each block in the monitoring area is predefined by the user, and q is the number of blocks in the monitoring area; The mode switching control module includes: A threshold value acquisition unit, used to acquire a pre-saved first exposure threshold value , the second exposure threshold And the calculated exposure of the current frame ; A mode determination unit, used to determine the current working mode; Day and night switching control unit, used to identify the current frame exposure in day mode Greater than the first exposure threshold When the control switches the day mode to the night mode, and turns on the fill light; Night-day switching control unit, used to check whether the previous frame of the current frame was in day mode in night mode, and the exposure of the current frame Less than the second exposure threshold , the second exposure threshold Reduce to the second exposure adjustment threshold , and the exposure value in the current frame Less than the second exposure adjustment threshold , control the switching of night mode to day mode, and when the N frames before the current frame are continuously in night mode, adjust the second exposure value threshold Increase to the second exposure threshold .