WO2023011191A1 - 昼夜切换方法、电子设备和存储介质 - Google Patents

昼夜切换方法、电子设备和存储介质 Download PDF

Info

Publication number
WO2023011191A1
WO2023011191A1 PCT/CN2022/106849 CN2022106849W WO2023011191A1 WO 2023011191 A1 WO2023011191 A1 WO 2023011191A1 CN 2022106849 W CN2022106849 W CN 2022106849W WO 2023011191 A1 WO2023011191 A1 WO 2023011191A1
Authority
WO
WIPO (PCT)
Prior art keywords
illuminance
factor
captured image
black
attenuation factor
Prior art date
Application number
PCT/CN2022/106849
Other languages
English (en)
French (fr)
Inventor
杨颖青
Original Assignee
西安宇视信息科技有限公司
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 西安宇视信息科技有限公司 filed Critical 西安宇视信息科技有限公司
Priority to EP22851905.4A priority Critical patent/EP4383739A1/en
Publication of WO2023011191A1 publication Critical patent/WO2023011191A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Definitions

  • the present disclosure relates to the field of camera control, for example, to a day and night switching method, electronic equipment and storage media.
  • Day and night switching control is an essential feature for front-end camera installations.
  • day and night switching refers to the camera judging whether the image is in color mode or black and white mode according to the image illuminance; for white light/warm light products, day and night switching refers to judging whether the supplementary light is on or off.
  • Diurnal switching strategies have become a focus of research.
  • the day-night switching strategy is to calibrate the day-night switching threshold according to the fixed environment. This strategy will cause the problem of repeatedly switching the day-night state in small scenarios.
  • the more common solution to this problem is to judge whether to switch between day and night according to the infrared ratio, or to add an external photoreceptor to assist in day and night switching.
  • the day and night switching strategy can no longer meet various types of camera devices, and has certain limitations.
  • the disclosure provides a day-night switching method applied to camera equipment, electronic equipment, and storage media.
  • the black-cut color threshold is dynamically adjusted.
  • the day and night switching of the camera equipment is controlled to avoid the problem of repeated switching of the camera equipment and improve the working stability of the camera equipment.
  • the present disclosure provides a day and night switching method, including:
  • the picture illuminance influencing factor is environmental illuminance
  • control the camera device to switch between day and night;
  • a new black-cut color threshold is determined according to the shooting parameters of the camera device and the captured image; according to the screen illuminance and the new black-cut color threshold Threshold, control the camera equipment to switch between day and night.
  • the present disclosure also provides an electronic device, comprising:
  • processors one or more processors
  • a storage device configured to store one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned day-night switching method.
  • the present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned day-night switching method is realized.
  • FIG. 1 is a flowchart of a day-night switching method provided by an embodiment of the present disclosure
  • FIG. 2 is a flow chart of another day-night switching method provided by an embodiment of the present disclosure.
  • Fig. 3 is a schematic diagram of an image division provided by an embodiment of the present disclosure.
  • Fig. 4 is a flowchart of another day-night switching method provided by an embodiment of the present disclosure.
  • Fig. 5 is a structural block diagram of an electronic device provided by an embodiment of the present disclosure.
  • All directional indications (such as up, down, left, right, front, back%) in the embodiments of the present disclosure are only used to explain the relative positional relationship between multiple components in a specific posture (as shown in the drawings) , sports conditions, etc., if the specific posture changes, the directional indication also changes accordingly.
  • connection can be a fixed connection, a detachable connection, or an integral body; it can be a mechanical
  • a connection can also be an electrical connection; it can be a direct connection or an indirect connection through an intermediary, and it can be an internal communication between two elements or an interaction relationship between two elements, unless otherwise limited.
  • day and night switching is an essential function for front-end camera devices. Whether it is for infrared products or white/warm light products, the day-night switching strategy that calibrates the day-night switching threshold according to a fixed environment may easily lead to the problem of repeatedly switching day-night status in small scenes or some specific scenes.
  • an embodiment of the present disclosure proposes a scheme to dynamically determine and adjust the black-cut color threshold, and then based on the determined black-cut Color threshold control camera equipment for day and night switching.
  • Light distribution curve diagram refers to the light intensity distribution of the light source in multiple directions in space.
  • the curve formed by marking the multi-directional luminous intensity values on the polar coordinate diagram is the light distribution curve of the lamp.
  • APEX Exposure Equation It is an empirical formula proposed by the American National Standards Institute for the convenience of calculating the exposure parameters of the film machine.
  • Chromaticity also known as hue, the color feeling produced when the human eye sees one or more wavelengths reflects the color type and determines the basic characteristics of the color. Hue is an attribute of color, which changes relatively continuously and describes the true color.
  • Brightness Also known as intensity or lightness, it refers to the human eye's perception of changes in the brightness and darkness of the surface of an object.
  • RGB color space It is the most common color space. Based on the three primary colors of red, green and blue, it is superimposed to varying degrees to produce rich and wide colors. However, there is a strong correlation between the three colors of RGB, and it is not a uniform color. space.
  • YUV color space It is a color coding method adopted by the European television system. It is mainly used to optimize the transmission of color video information. Compared with RGB video signal transmission, it only needs to occupy very little bandwidth. Among them, Y represents the lightness, that is, the grayscale value, UV represents the chroma, and the conversion between YUV and RGB is a linear conversion.
  • the Sensor It is a common and important sensor device. It is a device and device that senses the specified measured quantities and converts them into useful signals according to certain rules. Unless otherwise specified, the Sensor described in the embodiments of the present disclosure refers to a sensor device in an imaging device.
  • Gain Generally refers to the magnification of current or power of components, circuits, equipment or systems, specified in decibels (dB), and is a relative value. Unless otherwise specified, the device gain described in the embodiments of the present disclosure refers to the shooting device (camera) gain.
  • the present disclosure provides a day and night switching method, as shown in FIG. 1 , including:
  • Step 101 determine screen illuminance according to captured images acquired by a camera device.
  • Step 102 in the case that the screen illuminance is greater than the current black-cut color threshold, determine a screen illuminance influencing factor according to the captured image.
  • Step 103 if the screen illuminance influencing factor is environmental illuminance, control the camera device to switch between day and night according to the screen illuminance and the current black-cut color threshold.
  • Step 104 in the case that the screen illuminance influencing factor is a supplementary light, according to the shooting parameters of the camera device and the captured image, determine a new black-cut color threshold; according to the screen illuminance and the new Black cut color threshold, control the camera equipment to switch between day and night.
  • different black-cut color thresholds are determined according to different screen illuminance factors, and day-night switching control is performed accordingly, and software strategies can be used to optimize the black-cut color threshold without relying on auxiliary peripherals. , can effectively avoid the occurrence of repeated switching between day and night states, and has a higher cost performance.
  • the black-cut color or color-cut black mentioned in the embodiments of the present disclosure is an example.
  • the fill light is a white light or a warm light, it is expressed as turning on and turning off the light, that is, the fill light and non-light in the color mode. fill light.
  • the solution provided by the embodiment of the present disclosure is to determine the influence factor of screen illuminance based on the relevant attenuation factor, and to dynamically determine the black-cut color threshold.
  • controlling the camera to switch between day and night refers to the black-and-white Related to the color cut threshold, the switching control of the camera equipment (camera) from night mode to day mode.
  • the switching control and the switching control of the imaging device from the day mode to the night mode are collectively referred to as day and night switching.
  • the method before determining the screen illuminance influencing factor according to the captured image, the method further includes:
  • Step 1021 judging whether the illuminance of the picture has changed; if the illuminance of the picture has not changed, execute step 1022, controlling the imaging device to switch between day and night according to the illuminance of the picture and the current black-cut color threshold; In the case that the screen illuminance has changed, step 1023 is executed to determine a screen illuminance influencing factor according to the captured image.
  • judging whether the illuminance of the picture changes includes:
  • the first change range threshold is 2%
  • the change range of the current illuminance compared with the historical picture illuminance acquired last time is within plus or minus 2%
  • the change range of the historical picture illuminance acquired once is not within plus or minus 2%
  • the first change range threshold is sufficiently small and approaches 0, if the change range of the screen illuminance is smaller than the first change range, it indicates that the current screen illuminance is basically unchanged and has not changed.
  • the foregoing first change range threshold or the second change range threshold is set according to application requirements, and is not limited to the content exemplified in the present disclosure.
  • the fact that the screen illuminance does not change indicates that it is not necessary to determine the screen illuminance influencing factor according to the environment of the current camera equipment and the working status of the equipment, and it is not necessary to dynamically determine a new black-cut color threshold. , controlling the camera device to switch between day and night. If the change amplitude of the screen illuminance is greater than or equal to the change range threshold (the first change range threshold or the second change range threshold), it indicates that the environment of the current camera device and the working state of the device have degraded the captured image quality, and it is necessary to dynamically determine a new value.
  • the black-cut color threshold of In the case that the screen illuminance does not change, continue to use the calculated black-cut color threshold for subsequent day-night switching control, without more complicated judgments and calculations, which can reduce performance waste.
  • the initial value of the black-cut color threshold is predetermined according to the following method:
  • the acquisition of the initial day and night threshold is strongly related to the photosensitivity of the sensor and lens, so different sensors and lenses need to recalibrate the initial day and night threshold, also known as the basic day and night threshold.
  • the method for obtaining the initial diurnal threshold is as follows:
  • the camera equipment In the scene of a large dark room, the camera equipment is forced to be in color mode (day mode), and the ambient brightness is reduced. When the image quality does not meet the requirements, the ambient brightness value is read, and the ambient brightness value read at this time is set to color. Black cutting threshold T d2n .
  • Black-cut color or color-cut black is the standard meaning. When the fill light is white light or warm light, it means turning on and turning off the light.
  • the ambient illuminance is calculated by the gain, shutter, and aperture, and the calculation method of the ambient illuminance value can be expanded according to requirements.
  • a v represents the aperture size
  • T v represents the shutter speed
  • S v represents the camera sensitivity
  • B v represents the average illuminance of ambient light.
  • the initial value of the black-cut color threshold T n2d of the imaging device can be determined according to the above-mentioned step 2.
  • Those skilled in the art may also use other methods to determine the initial value of the black-cut color threshold of the imaging device, which is not limited to the specific manner of the examples in the present disclosure.
  • determining the screen illuminance influencing factor according to the captured image includes:
  • the captured image determine a first attenuation factor indicating the brightness uniformity of the central area and the edge area of the captured image; according to the captured image, determine the brightness uniformity indicating the center point of the captured image and the brightness uniformity of the four corners of the captured image
  • the second attenuation factor determine the screen illuminance influencing factor according to the first attenuation factor and the second attenuation factor.
  • determining the screen illuminance influencing factor according to the captured image includes:
  • the first attenuation factor of the captured image is smaller than the pre-calibrated first attenuation factor of the image without supplementary light of the imaging device, and the second attenuation factor of the captured image is smaller than the pre-calibrated image of the imaging device without supplementary light
  • the second attenuation factor of the picture is determined as the fill light; when the first attenuation factor of the captured image is greater than or equal to the pre-calibrated first attenuation factor of the image without fill light of the camera device, or When the second attenuation factor of the captured image is greater than or equal to the pre-calibrated second attenuation factor of the image without supplementary light of the imaging device, it is determined that the screen illuminance influencing factor is the ambient illuminance.
  • the center point described in the embodiments of the present disclosure includes a set of one or more pixel points at the center point position, and the four corner positions respectively include a set of one or more pixel points at each corner position of the captured image.
  • the image is divided into m*n blocks, the center point includes one or more blocks at the center position, and the four corner positions respectively include one or more blocks at each corner position.
  • the first attenuation factor D side of the image is calculated in the following manner:
  • the second attenuation factor D corner of the image is calculated according to the following manner:
  • the image is divided into m*n blocks, Y ij represents the average brightness of the block at row i and column j, and both m and n are integers greater than 1. In some exemplary embodiments, both m and n are even numbers greater than 1. In some exemplary embodiments, when m is an odd number, m/2 is the largest integer smaller than m/2, or the smallest integer greater than m/2; when n is an odd number, n/2 is smaller than n/2 The largest integer of 2, or the smallest integer greater than n/2.
  • calculating the corresponding first attenuation factor and the second attenuation factor according to the image includes the following aspects:
  • the unit of the attenuation factor is pixel/255
  • D side is the brightness ratio of the center area and the edge area, indicating the uniformity of the brightness of the center area and the edge area
  • D corner is the brightness ratio of the center point and the four corners, indicating the center position
  • the larger the attenuation factor the better the uniformity of the image, that is, the better the uniformity.
  • the attenuation factor is strongly related to the brightness of the image.
  • the brightness channel of the image is processed, and because the YUV space brightness and chromaticity Separate, and the conversion with RGB is a linear transformation, so it is calibrated in YUV space.
  • the RGB and YUV space conversion is shown in the following formula (4):
  • the first attenuation factor of the captured image is determined, that is, the first attenuation factor D side of the captured image is calculated according to the above formula (2); the first attenuation factor D side of the captured image is determined;
  • the second attenuation factor is to calculate the second attenuation factor D corner of the captured image according to the above formula (3).
  • step 102 in the process of determining the screen illuminance influencing factor, the pre-calibrated first attenuation factor of the image without supplementary light of the imaging device and the second attenuation factor of the image without supplementary light of the imaging device are used.
  • the pre-calibration process for the imaging device is performed according to the following steps, which is also called a priori attenuation factor acquisition process:
  • the intensity of the supplementary light is expressed by L, the maximum intensity is Lmax, the minimum intensity is Lmin, and L0 is not turned on; the distance between the shooting equipment (camera) and the white wall during calibration is expressed by H; the equipment gain is expressed by Gain , the device gain when the light is turned on normally is represented by Gain loseless .
  • the data corresponding to the row where L0 is located is the first attenuation factor, the second attenuation factor and the picture illuminance obtained by the imaging device under the experimental environment without a supplementary light (the supplementary light is turned off); the data of the row where Lmax is located corresponds to The first attenuation factor, the second attenuation factor and the screen illuminance obtained by the imaging device under the maximum intensity of the supplementary light in the experimental environment; The first attenuation factor, the second attenuation factor and the screen illuminance obtained when the lamp intensity is minimum.
  • the method of obtaining parameters is as follows:
  • the camera equipment Set up the camera equipment at a distance H from the white wall, adjust the ambient brightness until the equipment gain is Gain loseless , turn off the fill light, and read the current screen illuminance value E L0 after the exposure is stable.
  • After converting the captured image to YUV space obtain the original attenuation values D0 side and D0 corner . That is, according to the image collected by the imaging device in this case, the first attenuation factor D0 side of the image without supplementary light of the imaging device and the first attenuation factor D0 side of the image without supplementary light of the imaging device are calculated using the above formula (2) and formula (3).
  • the second attenuation factor D0 corner is calculated using the above formula (2) and formula (3).
  • the intensity of the supplementary light is the maximum Lmax, and read the current screen illuminance value E Lmax after the exposure is stable.
  • the above formula (2) and formula (3) are used to calculate the camera device
  • the first attenuation factor Dmax side of the strongest supplementary light image and the second attenuation factor Dmax corner of the strongest supplementary light image of the camera device; then adjust to the minimum intensity Lmin, and read the current ambient brightness value E after the exposure is stable Lmin , according to the images collected by the imaging equipment in this case, the first attenuation factor Dmin side of the weakest supplementary light image of the imaging equipment and the weakest side of the imaging equipment are calculated by using the above formula (2) and formula (3).
  • the second attenuation factor Dmin corner of the supplementary light image is recorded in the above Table 1, and the above-mentioned prior attenuation factor will be used in the subsequent steps
  • Determining the screen illuminance influencing factor in step 102 includes:
  • the influence factor of the screen illumination is determined to be the supplementary light.
  • the second attenuation factor D corner of the captured image is greater than or equal to the preset
  • the second attenuation factor D0 corner of the calibrated image of the imaging device without supplementary light is determined to be the ambient illuminance influencing factor of the picture illumination; it indicates that the first attenuation factor and the second attenuation factor calculated according to the current captured image are characterized by The brightness uniformity of the image is relatively good.
  • the environmental illuminance is determined as the influencing factor of the screen illuminance.
  • performing step 102 can determine that the illuminance of the image captured by the current device is affected by the supplementary light, It is still the normal environment illuminance, that is, determine the corresponding image illuminance influencing factor, and then execute step 103 or 104 according to the difference of the image illuminance influencing factor.
  • step 103 In the case that the image illuminance influencing factor is ambient illuminance, step 103 is performed, and there is no need to dynamically adjust the black-cut color threshold. In the case that the image illuminance influencing factor is fill light, step 104 needs to be performed to dynamically adjust the black-cut color threshold to make the black-cut color threshold for controlling day-night switching more reasonable, and to avoid switching back and forth due to the influence of fill light factors The problem.
  • a new black-cut color threshold is determined, including:
  • the second attenuation factor of the captured image determines the first black-cut color threshold factor; according to the brightness of the fill light and the device gain in the shooting parameters , determine a second black-cut color threshold factor; determine the new black-cut color threshold according to the first black-cut color threshold factor, the second black-cut color threshold factor, and the current black-cut color threshold.
  • the first black-cut color threshold factor Determined according to the following formula:
  • D side is the first attenuation factor of the captured image
  • D corner is the second attenuation factor of the captured image
  • is a preset adjustment parameter, 0 ⁇ 1
  • Dmax side is the pre-calibrated
  • Dmin side is the first attenuation factor of the weakest supplementary light image of the described camera equipment calibrated in advance
  • Dmax corner is the strongest supplementary light image of the described camera equipment demarcated in advance
  • the second attenuation factor of the light image, Dmin corner is the pre-calibrated second attenuation factor of the weakest supplementary light image of the imaging device.
  • Dmax side , Dmin side , Dmax corner , and Dmin corner are related first attenuation factors and second attenuation factors obtained in the pre-calibration process.
  • the first black-cut color threshold factor is determined according to the first attenuation factor D side , the second attenuation factor D corner of the current image and the set adjustment parameter ⁇ by using formula (5).
  • the adjustment parameter ⁇ is used to adjust the weight of the first attenuation factor D side and the second attenuation factor D corner for calculating the first black-cut color threshold factor, and the larger the adjustment parameter ⁇ is, the higher the weight of the first attenuation factor D side is; The smaller the adjustment parameter ⁇ is, the higher the weight of the second attenuation factor D corner is.
  • the adjustment parameter ⁇ is determined according to the characteristics of the image captured by the shooting device, so as to reduce the influence of the first black-cut color threshold factor by the shooting characteristics of the shooting device.
  • the adjustment parameter ⁇ is increased, the weight of the first attenuation factor D side is increased, and the weight of the second attenuation factor D corner is decreased, so that the first black-cut color threshold factor More affected by the first attenuation factor D side .
  • the adjustment parameter ⁇ is reduced to reduce the first attenuation factor D side Increase the weight of the second attenuation factor D corner , so that the first black-cut color threshold factor is more affected by the second attenuation factor D corner . Accordingly, according to the shooting characteristics of the camera device, the adjustment parameter ⁇ is correspondingly adjusted to reduce the influence of the camera device.
  • the second black-cut color threshold factor F (L, Gain) is determined according to the following attenuation function obtained by pre-fitting:
  • L is the brightness of the fill light
  • Gain is the equipment gain
  • A1, A0, B1 and B are pre-fitted constants, A1 ⁇ 0, B>1, B1>0, A0>0; the new black cut
  • the color threshold is determined according to the following formula:
  • T n2d is the current black-cut color threshold
  • T n2d-new is the new black-cut color threshold
  • the pre-calibration process for the imaging device also includes:
  • the black-cut color threshold is affected by the device gain and the intensity of the fill light. Assuming that the maximum gain of the device is Gainmax, and other factors remain unchanged, as the device gain increases, the black-cut color threshold will increase. In the case of other factors being constant, due to the non-linear intensity change of the supplementary light, according to the intensity response of the supplementary light, the black-cut color threshold roughly shows a logarithmic increasing trend. And when the environment is bright, the light of the fill light has little influence on the black cut color threshold. Therefore, construct an attenuation function related to device gain and fill light intensity to determine the second black-cut color threshold factor, as follows:
  • A1, A0, B1 and B are parameters fitted according to the actual situation of the camera equipment and fill light, which are constants and satisfy A1 ⁇ 0, B>1, B1>0, A0>0.
  • Those skilled in the art can implement the fitting step by using a corresponding fitting method according to the sample data, which does not belong to the protection or limitation scope of the embodiments of the present disclosure.
  • a new black-cut color threshold is determined according to formula (7).
  • This dynamically determined black-cut color threshold can effectively avoid day and night switching control
  • the problem of repeatedly switching the day and night state in the middle ensures that after switching from the night mode to the day mode due to the fill light, it will not switch back to the night mode again due to the turn off of the fill light.
  • An embodiment of the present disclosure also provides a day-night switching method, as shown in FIG. 4 , including:
  • Step 401 acquire image information captured by an imaging device.
  • Step 402 in a case where it is determined according to the image information that a black-cut color threshold adjustment is to be performed, determine a first black-cut color threshold factor according to the image information.
  • Step 403 Determine a second black-cut color threshold factor according to the device gain and the intensity of the fill light.
  • Step 404 Determine a new black-cut color threshold according to the first black-cut color threshold factor, the second black-cut color threshold factor and the current black-cut color threshold.
  • Step 405 according to the image information and the new black-cut color-cut threshold, judge whether the black-cut color-cut condition is satisfied, and if the black-cut color-cut condition is satisfied, control the imaging device to perform a black-cut color-cut operation.
  • the method before step 401, the method further includes:
  • Step 400 acquiring pre-calibration data of the imaging device.
  • the pre-calibration data includes: an initial value of a black-cut color threshold.
  • the pre-calibration data further includes: a first attenuation factor D0 side of the image without supplementary light of the imaging device and a second attenuation factor D0 corner of the image of the imaging device without supplementary light, the imaging The first attenuation factor Dmax side of the strongest fill light image of the device and the second attenuation factor Dmax corner of the strongest fill light image of the camera device, and the first attenuation factor Dmin of the weakest fill light image of the camera device side and the second attenuation factor Dmin corner of the weakest supplementary light image of the camera device.
  • the pre-calibration data also includes: a pre-fitted attenuation function, that is, a constant in the attenuation function obtained by fitting:
  • the calculation method of the above-mentioned pre-calibration data can adopt the methods exemplified in the above-mentioned embodiments, which will not be repeated here.
  • the image information includes: image illuminance and image illuminance influencing factors.
  • Factors affecting image illuminance include: fill light or ambient illuminance.
  • the image illuminance influencing factor is determined according to the first attenuation factor D side , the second attenuation factor D corner of the image information captured by the imaging device, and D0 side and D0 side in the pre-calibration data.
  • step 402 according to the image information, it is determined that a black-cut color threshold adjustment is to be performed, including:
  • the black-cut color threshold adjustment is to be performed; when the picture illuminance is not greater than the current black-cut color threshold In the case of the color threshold, the adjustment of the black-cut color threshold is not performed, and the day-night switching control of the imaging device is performed according to the current black-cut color threshold.
  • determining the first black-cut color threshold factor according to the image information in step 402 includes:
  • the first black is determined according to formula (5).
  • the second black-cut color threshold factor F(L, Gain) is determined according to formula (6).
  • a new black-cut color threshold is determined according to formula (7).
  • an embodiment of the present disclosure also provides an electronic device.
  • the electronic device includes: one or more processors 501 (only one processor 501 is shown in FIG. 5 exemplarily); a storage device 502 configured to One or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the day-night switching method as described in any one of the above embodiments.
  • An embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and the program is used by a processor to implement the day-night switching method as described in any one of the above-mentioned embodiments.
  • the day-night switching solution calculates the first attenuation factor and the second attenuation factor based on the captured images, and then judges whether the screen illuminance of the currently captured image is more affected by the environment or more affected by the fill light. Determine different black-cut color thresholds separately, which can make more accurate day and night judgments, and is applicable to all shooting systems with fill lights.
  • the brightness uniformity of the central area and the edge area, and the brightness uniformity of the central point and the four corners are considered, and the first attenuation factor and the second attenuation factor are introduced, and the intensity of the fill light, Due to the influence of equipment gain, the black-cut color threshold is dynamically adjusted, which improves the environmental adaptability of the black-cut color threshold, thereby improving the accuracy of day-night switching judgment.
  • the functional modules/units in the system, and the device can be implemented as software, firmware, hardware, and an appropriate combination thereof.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of multiple The physical components cooperate to perform.
  • Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit.
  • Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
  • computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media.
  • Computer storage media include but not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Video Disc (DVD) or other optical disc storage, magnetic cartridges, tapes, magnetic disk storage or other magnetic storage devices , or any other medium that can be set to store desired information and can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Color Television Image Signal Generators (AREA)

Abstract

本文公开了一种昼夜切换方法、电子设备和存储介质。该昼夜切换方法包括:根据摄像设备所获取的拍摄图像确定画面照度;在画面照度大于当前黑切彩阈值的情况下,根据拍摄图像确定画面照度影响因子;在画面照度影响因子为环境照度的情况下,根据画面照度和当前的黑切彩阈值,控制摄像设备进行昼夜切换;在画面照度影响因子为补光灯的情况下,根据摄像设备的拍摄参数和拍摄图像,确定新的黑切彩阈值;根据画面照度和新的黑切彩阈值,控制摄像设备进行昼夜切换。

Description

昼夜切换方法、电子设备和存储介质
本申请要求在2021年08月04日提交中国专利局、申请号为202110892573.X的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及摄像装置控制领域,例如涉及一种昼夜切换方法、电子设备和存储介质。
背景技术
伴随数码相机技术的不断发展,摄像装置的种类越来越多,对于摄像装置的挑战也越来越大。昼夜切换控制对于前端摄像装置是必不可少的功能。对于红外产品,昼夜切换指的是摄像机根据图像照度判断图像是处于彩色模式还是处于黑白模式;对于白光/暖光产品,昼夜切换指的是判断补光灯是处于开灯状态还是关灯状态。昼夜切换策略已经成为研究的一个重点。昼夜切换策略是根据固定环境标定昼夜切换阈值,此策略在小场景中会出现反复切换昼夜状态的问题。而针对此问题较常用的解决方法是根据红外占比去判断是否切换昼夜状态或者加外设感光器去辅助昼夜切换。昼夜切换策略已不能满足多种类的摄像装置,有一定的局限性。
发明内容
本公开提供一种应用于摄像设备的昼夜切换方法、电子设备和存储介质,根据所拍摄图像的画面照度影响因子,在确定当前画面照度受补光灯影响的情况下,动态调整黑切彩阈值,根据新的黑切彩阈值控制摄像设备的昼夜切换,以避免摄像设备出现反复切换的问题,提升了摄像设备的工作稳定性。
本公开提供了一种昼夜切换方法,包括:
根据摄像设备所获取的拍摄图像确定画面照度;
在所述画面照度大于当前黑切彩阈值的情况下,根据所述拍摄图像确定画面照度影响因子;
在所述画面照度影响因子为环境照度的情况下,根据所述画面照度和当前的黑切彩阈值,控制所述摄像设备进行昼夜切换;
在所述画面照度影响因子为补光灯的情况下,根据所述摄像设备的拍摄参数和所述拍摄图像,确定新的黑切彩阈值;根据所述画面照度和所述新的黑切 彩阈值,控制所述摄像设备进行昼夜切换。
本公开还提供一种电子设备,包括:
一个或多个处理器;
存储装置,设置为存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述的昼夜切换方法。
本公开还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述的昼夜切换方法。
附图说明
图1是本公开实施例提供的一种昼夜切换方法的流程图;
图2是本公开实施例提供的另一种昼夜切换方法的流程图;
图3是本公开实施例提供的一种图像划分的示意图;
图4是本公开实施例提供的另一种昼夜切换方法的流程图;
图5是本公开实施例提供的一种电子设备的结构框图。
具体实施方式
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行描述,所描述的实施例仅仅是本公开的一部分实施例。
本公开实施例中所有方向性指示(诸如上、下、左、右、前、后……)仅用于解释在一特定姿态(如附图所示)下多个部件之间的相对位置关系、运动情况等,如果该特定姿态发生改变时,则该方向性指示也相应地随之改变。
另外,在本公开中如涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本公开的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有限定。
在本公开中,除非另有规定和限定,术语“连接”、“固定”等应做广义理解,例如,“固定”可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系,除非另有限定。对于本领域的普通技术人员而言,可以根据情况理解上述术语在本公开中的含义。
另外,本公开多个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础。
随着数码像机技术的不断发展,摄像装置的种类越来越多,昼夜切换对于前端摄像装置是必不可少的功能。不论是对于红外产品,还是白光/暖光产品,根据固定环境标定昼夜切换阈值的昼夜切换策略,容易导致在小场景或一些特定场景下出现反复切换昼夜状态问题。为了克服该缺陷,同时减小引入其他外设感光器引起的系统复杂度提升,并避免成本增加,本公开实施例提出了动态确定\调整黑切彩阈值的方案,进而基于所确定的黑切彩阈值控制摄像设备进行昼夜切换。
在相关实施例之前,先介绍几个本公开实施例涉及的方面:
配光曲线图:是指光源在空间的多个方向的光强分布,在极坐标图上标出多方位的发光强度值所连成的曲线就是灯具的配光曲线。
照相曝光的加法系统(The Additive System of Photographic Exposure,APEX)曝光方程:是由美国国家标准机构为了方便计算胶片机的曝光参数,提出的一个经验公式。
色度:又称色相,当人眼看到一种或多种波长时所产生的彩色感觉,反映颜色种类,决定颜色的基本特性。色调是颜色的属性,相对连续变化,描述真正色彩。
亮度:又称为强度或明度,是指人眼对物体表面明暗程度变化的感觉。
RGB颜色空间:是最为常见的颜色空间,由红绿蓝三原色为基础,进行不同程度的叠加,产生丰富而广泛的颜色,但RGB三色之间存在较强的相关性,且不是均匀的彩色空间。
YUV颜色空间:是被欧洲电视系统所采用的一种颜色编码方法。主要用于优化彩色视频信息的传输。与RGB视频信号传输相比,只需要占用极少的频宽。其中,Y表示明度,也就是灰阶值,UV表示色度,且YUV与RGB的转换为线性转换。
Sensor:是一种常见且重要的传感器件,是感受规定的被测量的多种量并按照一定规律将其强转为有用信号的器件和装置。在无特殊说明的情况下,本公开实施例中记载的Sensor是指摄像设备中的传感器件。
增益:一般指对元器件、电路、设备或系统,其电流或功率的放大倍数,以分贝(dB)数来规定,是一个相对值。在无特殊说明的情况下,本公开实施例中记载的设备增益是指拍摄设备(相机)增益。
本公开提供一种昼夜切换方法,如图1所示,包括:
步骤101,根据摄像设备所获取的拍摄图像确定画面照度。
步骤102,在所述画面照度大于当前黑切彩阈值的情况下,根据所述拍摄图像确定画面照度影响因子。
步骤103,在所述画面照度影响因子为环境照度的情况下,根据所述画面照度和当前的黑切彩阈值,控制所述摄像设备进行昼夜切换。
步骤104,在所述画面照度影响因子为补光灯的情况下,根据所述摄像设备的拍摄参数和所述拍摄图像,确定新的黑切彩阈值;根据所述画面照度和所述新的黑切彩阈值,控制所述摄像设备进行昼夜切换。
本公开实施例提供的方案,根据画面照度影响因子的不同,确定不同的黑切彩阈值,并据此进行昼夜切换控制,能够不依赖于辅助外设,使用软件策略进行黑切彩阈值的优化,能够有效避免反复切换昼夜状态的发生,同时具有更高性价比。
本公开实施例中所述的黑切彩或彩切黑为范意,当补光灯为白光灯或暖光灯时,则表示为开灯和关灯,即彩色模式下的补光与不补光。
本公开实施例提供的方案是基于相关衰减因子确定画面照度影响因子,以及动态确定黑切彩阈值的方案,步骤103和步骤104中所述的控制所述摄像设备进行昼夜切换,是指与黑切彩阈值相关的,摄像设备(相机)从夜晚模式到白昼模式的切换控制。该切换控制与摄像设备从白昼模式切换到夜晚模式的切换控制,统称为昼夜切换。
一些示例性实施例中,如图2所示,在根据所述拍摄图像确定画面照度影响因子之前,所述方法还包括:
步骤1021,判断所述画面照度是否发生变化;在所述画面照度未发生变化的情况下,执行步骤1022,根据所述画面照度和当前的黑切彩阈值,控制所述摄像设备进行昼夜切换;在所述画面照度已发生变化的情况下,执行步骤1023,根据所述拍摄图像确定画面照度影响因子。
一些示例性实施例中,判断所述画面照度是否发生变化,包括:
计算当前画面照度相比于上一次获取的历史画面照度的变化幅度,当所述变化幅度小于第一变化幅度阈值时,确定所述画面照度未发生变化;当所述变化幅度大于或等于第一变化幅度阈值时,确定所述画面照度已发生变化;或者,计算当前画面照度相比于前N次获取的历史画面照度的平均值的变化幅度,当所述变化幅度小于第二变化幅度阈值时,确定所述画面照度未发生变化;当所 述变化幅度大于或等于第二变化幅度阈值时,确定所述画面照度已发生变化。
例如,第一变化幅度阈值为2%,则当前照度相比于上一次获取的历史画面照度的变化幅度在正负2%以内时,确定所述画面照度未发生变化;当前照度相比于上一次获取的历史画面照度的变化幅度不在正负2%以内时,则确定所述画面照度已发生变化。又例如,第一变化幅度阈值足够小趋近于0时,如果画面照度变化幅度小于该第一变化幅度,则表明当前画面照度基本不变,未发生变化。上述第一变化幅度阈值或第二变化幅度阈值根据应用需求设定,不限于本公开所例举的内容。
本实施例中,画面照度未发生变化表明根据当前摄像设备的环境和设备的工作状态无需确定画面照度影响因子,更无需动态确定新的黑切彩阈值,只需要根据已有的黑切彩阈值,控制所述摄像设备进行昼夜切换。画面照度的变化幅值大于或等于变化幅度阈值(第一变化幅度阈值或第二变化幅度阈值),则表明当前摄像设备的环境和设备的工作状态使得拍摄到的图像质量下降,需要动态确定新的黑切彩阈值。在画面照度未发生变化的情况下,继续采用已计算得到的黑切彩阈值进行后续昼夜切换控制,无需更多复杂判断和计算,能够有减少性能浪费。
一些示例性实施例中,所述黑切彩阈值的初始值,根据以下方法预先确定:
在暗室场景中,设置所述摄像设备为夜晚模式,打开补光灯,逐步增大环境亮度,在所述摄像设备获取的图像除去补光灯因素后画质满足预设画质要求的情况下,获取当前环境照度值作为所述黑切彩阈值的初始值。
初始的昼夜阈值的获取与sensor的感光性及镜头感光性强相关,所以不同的sensor、镜头都需要重新标定初始的昼夜阈值,也称为基础昼夜阈值。
一些示例性实施例中,初始的昼夜阈值获得方法如下:
1、在大暗室场景,摄像设备强制为彩色模式(白昼模式),降低环境亮度,当图像画质达不到要求时,读取环境亮度值,将此时读取的环境亮度值设为彩切黑阈值T d2n
2、再将摄像设备强制为夜晚模式,补光灯打开,逐步增大环境亮度,当所获取的图像去除补光灯因素后画质满足预设的画质要求时(补光灯保持开启),读取此时环境照度值及当前摄像设备的增益值,设为黑切彩阈值T n2d及黑切彩增益Gain loseless
黑切彩或彩切黑为范意,当补光灯为白光灯或暖光灯时,则表示为开灯和关灯。
环境照度由增益、快门、光圈计算得到,环境照度值的计算方式可按照需 求进行扩展。
一些示例性实施例中,使用APEX曝光方程获得。公式如下:
A v+T v=S v+B v     (1)
其中,A v表示光圈大小;T v表示快门快慢;S v表示相机感度;B v表示环境光的平均照度。
根据上述2的步骤可以确定所述摄像设备的黑切彩阈值T n2d的初始值。本领域技术人员也可以采用其他方法确定所述摄像设备的黑切彩阈值的初始值,不限于本公开示例的特定方式。
一些示例性实施例中,步骤102中根据所述拍摄图像确定画面照度影响因子,包括:
根据所述拍摄图像,确定指示所述拍摄图像的中心区域亮度和边缘区域亮度均一性的第一衰减因子;根据所述拍摄图像,确定指示所述拍摄图像的中心点亮度和四角位置亮度均一性的第二衰减因子;根据所述第一衰减因子和第二衰减因子确定所述画面照度影响因子。
一些示例性实施例中,步骤102中根据所述拍摄图像确定画面照度影响因子,包括:
根据所述拍摄图像的中心区域亮度和边缘区域亮度,确定所述拍摄图像的第一衰减因子;根据所述拍摄图像的中心点亮度和四角位置亮度,确定所述拍摄图像的第二衰减因子;当所述拍摄图像的第一衰减因子小于预先标定的所述摄像设备的无补光图像的第一衰减因子,且所述拍摄图像的第二衰减因子小于预先标定的所述摄像设备的无补光图像的第二衰减因子时,确定所述画面照度影响因子为补光灯;当所述拍摄图像的第一衰减因子大于或等于预先标定的所述摄像设备的无补光图像的第一衰减因子,或所述拍摄图像的第二衰减因子大于或等于预先标定的所述摄像设备的无补光图像的第二衰减因子时,确定所述画面照度影响因子为环境照度。
本公开实施例中记载的中心点包括中心点位置上一个或多个像素点的集合,四角位置分别包括拍摄图像的每个角位置上的一个或多个像素点的集合。一些示例性实施例中,图像划分为m*n个块,中心点包括中心位置上的一个或多个块,四角位置分别包括每个角位置上的一个或多个块。
一些示例性实施例中,图像的第一衰减因子D side根据以下方式计算:
Figure PCTCN2022106849-appb-000001
图像的第二衰减因子D corner根据以下方式计算:
Figure PCTCN2022106849-appb-000002
其中,所述图像被划分为m*n个块,Y ij表示第i行第j列位置的块的平均亮度,m和n均为大于1的整数。一些示例性实施例中,m和n均为大于1的偶数。一些示例性实施例中,m为奇数的情况下,m/2取小于m/2的最大整数,或取大于m/2的最小整数;n为奇数的情况下,n/2取小于n/2的最大整数,或取大于n/2的最小整数。
一些示例性实施例中,根据图像计算相应的第一衰减因子和第二衰减因子,包括以下方面:
如图3所示,图像划分为m*n个块,m和n可以相等或不等,分别计算每一块的平均亮度Y ij后,根据上述公式(2)和公式(3)分别计算第一衰减因子D side和第二衰减因子D corner;图3中K=0所示的区域为中心区域,K=1所示的区域为边缘区域。其中,衰减因子的单位为pixel/255,D side为中心区域与边缘区域的亮度比值,指示中心区域亮度和边缘区域亮度的均一性,D corner为中心点与四角位置的亮度比值,指示中心位置亮度和四角位置亮度的均一性,衰减因子越大说明图像的均匀度越好,即均一性更好。
本公开实施例提供的方案中衰减因子与图像亮度强相关,为了既提高标定速度又能保证效果,一些示例性实施例中,只对图像的亮度通道进行处理,又因YUV空间亮度与色度分开,且与RGB的转换是线性变换,所以在YUV空间进行标定。RGB与YUV空间转换如下公式(4)所示:
Figure PCTCN2022106849-appb-000003
相应地,一些示例性实施例中,步骤102中确定所述拍摄图像的第一衰减因子,即根据上述公式(2)计算所拍摄图像的第一衰减因子D side;确定所述拍摄图像的第二衰减因子,即根据上述公式(3)计算所拍摄图像的第二衰减因子D corner
步骤102中确定画面照度影响因子的过程中,利用了预先标定的所述摄像设备的无补光图像的第一衰减因子以及所述摄像设备的无补光图像的第二衰减因子。一些示例性实施例中,这些针对所述摄像设备的预先标定过程根据以下步骤进行,该过程也称为先验衰减因子获取过程:
1、假设补光灯的强度用L表示,则最大强度为Lmax,最小强度为Lmin,不开灯为L0;标定时拍摄设备(相机)与白墙的距离用H表示;设备增益用 Gain表示,则正常开灯时的设备增益用Gain loseless表示。
2、获取先验衰减因子,在实验室标定获得如下表格:
表1-先验衰减因子表
LED强度 D side D corner 画面照度
L0 D0 side D0 corner E L0
Lmax Dmax side Dmax corner E Lmax
Lmin Dmin side Dmin corner E Lmin
L0所在行的数据对应为所述摄像设备在实验环境下在无补光灯(补光灯关闭)的情况下获得的第一衰减因子、第二衰减因子和画面照度;Lmax所在行的数据对应为所述摄像设备在实验环境下在补光灯强度最大的情况下获得的第一衰减因子、第二衰减因子和画面照度;Lmin所在行的数据对应为所述摄像设备在实验环境下在补光灯强度最小的情况下获得的第一衰减因子、第二衰减因子和画面照度。
参数获得方法如下所示:
将摄像设备架在与白墙距离为H的位置,调节环境亮度到设备增益为Gain loseless,关闭补光灯,等曝光稳定后读取当前画面照度值E L0。将采集图像转换为YUV空间后,获取原始衰减值D0 side和D0 corner。即,根据该情况下摄像设备采集到的图像,采用上述公式(2)和公式(3)计算所述摄像设备的无补光图像的第一衰减因子D0 side和所述摄像设备的无补光图像的第二衰减因子D0 corner
由于不同补光灯配光曲线图不一样,则需要根据现实需求开灯标定。调节补光灯的强度为最大Lmax,等曝光稳定后读取当前画面照度值E Lmax,根据该情况下摄像设备采集到的图像,采用上述公式(2)和公式(3)计算所述摄像设备的最强补光图像的第一衰减因子Dmax side和所述摄像设备的最强补光图像的第二衰减因子Dmax corner;再调节为最小强度Lmin,等曝光稳定后读取当前环境亮度值E Lmin,根据该情况下摄像设备采集到的图像,采用上述公式(2)和公式(3)计算所述摄像设备的最弱补光图像的第一衰减因子Dmin side和所述摄像设备的最弱补光图像的第二衰减因子Dmin corner,记录上述表1,上述先验衰减因子将被后续步骤使用。
步骤102中确定画面照度影响因子包括:
当所述拍摄图像的第一衰减因子D side小于预先标定的所述摄像设备的无补光图像的第一衰减因子D0 side,且所述拍摄图像的第二衰减因子D corner小于预先标定的所述摄像设备的无补光图像的第二衰减因子D0 corner时,确定所述画面照度影响因子为补光灯;表明根据当前拍摄图像计算得到的第一衰减因子和第二衰减因子所表征的图像亮度匀一性相对较差,依此判断当前拍摄图像的画面照度受到补光灯影响较大,因此,确定画面照度影响因子为补光灯。
当所述拍摄图像的第一衰减因子D side大于或等于预先标定的所述摄像设备的无补光图像的第一衰减因子D0 side,或所述拍摄图像的第二衰减因子D corner大于或等于预先标定的所述摄像设备的无补光图像的第二衰减因子D0 corner时,确定所述画面照度影响因子为环境照度;表明根据当前拍摄图像计算得到的第一衰减因子和第二衰减因子所表征的图像亮度匀一性相对较好,依此判断当前拍摄图像的画面照度受到补光灯影响较小,画面照度主要受环境照度影响,因此,确定画面照度影响因子为环境照度。
参考预先标定的所述摄像设备在无补光灯时拍摄图像的第一衰减因子D0 side和第二衰减因子D0 corner,执行步骤102能够确定当前设备拍摄到的图像的照度是受补光灯影响,还是正常的环境照度,即确定对应的图像照度影响因子,再根据图像照度影响因子的不同执行步骤103或104。
在图像照度影响因子为环境照度的情况下,执行步骤103,这时无需动态调整黑切彩阈值。在图像照度影响因子为补光灯的情况下,执行步骤104,则需要动态调整黑切彩阈值,以使得控制昼夜切换的黑切彩阈值更合理,避免因补光灯因素的影响造成来回切换的问题。
一些示例性实施例中,步骤104中根据所述摄像设备的拍摄参数和所述拍摄图像,确定新的黑切彩阈值,包括:
根据所述拍摄图像的第一衰减因子、所述拍摄图像的第二衰减因子和预设的调节参数,确定第一黑切彩阈值因子;根据所述拍摄参数中的补光灯亮度和设备增益,确定第二黑切彩阈值因子;根据所述第一黑切彩阈值因子、所述第二黑切彩阈值因子和当前黑切彩阈值,确定所述新的黑切彩阈值。
一些示例性实施例中,所述第一黑切彩阈值因子
Figure PCTCN2022106849-appb-000004
根据以下公式确定:
Figure PCTCN2022106849-appb-000005
其中,D side为所述拍摄图像的第一衰减因子,D corner为所述拍摄图像的第 二衰减因子,α为预设的调节参数,0≤α≤1;Dmax side为预先标定的所述摄像设备的最强补光图像的第一衰减因子,Dmin side为预先标定的所述摄像设备的最弱补光图像的第一衰减因子;Dmax corner为预先标定的所述摄像设备的最强补光图像的第二衰减因子,Dmin corner为预先标定的所述摄像设备的最弱补光图像的第二衰减因子。
这里的Dmax side、Dmin side、Dmax corner、Dmin corner即为预先标定过程中获得的相关第一衰减因子和第二衰减因子。采用公式(5)根据当前图像的第一衰减因子D side、第二衰减因子D corner和设置的调节参数α,确定第一黑切彩阈值因子。其中,调节参数α用于调节第一衰减因子D side和第二衰减因子D corner对于计算第一黑切彩阈值因子的权重,调节参数α越大,表明第一衰减因子D side权重越高;调节参数α越小,表明第二衰减因子D corner权重越高。调节参数α根据拍摄设备所拍摄的图像的特点决定,以减小第一黑切彩阈值因子受拍摄设备的拍摄特点的影响。
例如,摄像设备拍摄得到的图像存在暗角现象,则将调节参数α变大,提高第一衰减因子D side的权重,减小第二衰减因子D corner的权重,使得第一黑切彩阈值因子更多受到第一衰减因子D side的影响。又例如,拍摄设备拍摄的图像平整度不好,如上下边或左右边比例不一致(例如上窄下宽,左窄右宽等),则将调节参数α变小,减小第一衰减因子D side的权重,提高第二衰减因子D corner的权重,使得第一黑切彩阈值因子更多受到第二衰减因子D corner的影响。据此,根据摄像设备的拍摄特点,对应调整调节参数α,可以减小拍摄设备的影响。
所述第二黑切彩阈值因子F(L,Gain)根据预先拟合得到的以下衰减函数确定:
Figure PCTCN2022106849-appb-000006
其中,L为补光灯亮度,Gain为设备增益;A1,A0,B1和B为预先拟合确定常数,A1<0,B>1,B1>0,A0>0;所述新的黑切彩阈值根据以下公式确定:
Figure PCTCN2022106849-appb-000007
其中,T n2d为当前黑切彩阈值,T n2d-new为所述新的黑切彩阈值。
一些示例性实施例中,针对所述摄像设备的预先标定过程除了前述步骤1、2外,还包括:
3、根据经验可以得知黑切彩阈值受设备增益及补光灯强度影响,假设设备最大增益为Gainmax,在其他因素不变的情况下,随着设备增益的增大,黑切彩阈值会成递减的趋势;在其他因素不变的情况下,由于补光灯的强度变化非线 性,根据补光灯的强度响应,黑切彩阈值大致呈对数递增的趋势。且当环境较亮时,补光灯的灯光对黑切彩阈值的影响较小。所以构造与设备增益及补光灯强度相关的衰减函数来确定第二黑切彩阈值因子,如下所示:
Figure PCTCN2022106849-appb-000008
A1,A0,B1和B为根据摄像设备和补光灯的实际情况拟合出的参数,为常量,且满足A1<0,B>1,B1>0,A0>0。本领域技术人员根据样本数据,采用相应的拟合方法即可实现拟合步骤,不属于本公开实施例保护或限定的范围。
根据公式(5)和公式(6)计算得到第一黑切彩阈值因子和第二黑切彩阈值因子后,再根据公式(7)确定新的黑切彩阈值。根据当前拍摄图像的第一衰减因子,第二衰减因子,以及当前补光灯的亮度和设备增益,共同确定了新的黑切彩阈值,这个动态确定的黑切彩阈值能够有效避免昼夜切换控制中反复切换昼夜状态的问题,确保了不会因为补光灯的因素使得当从夜晚模式切到白昼模式后,又因补光灯的关闭再次切换回夜晚模式。提高了昼夜切换方案中,黑切彩阈值的准确性,保证了昼夜切换功能的稳定性。
本公开实施例还提供一种昼夜切换方法,如图4所示,包括:
步骤401,获取摄像设备拍摄的图像信息。
步骤402,根据所述图像信息确定要进行黑切彩阈值调整的情况下,根据所述图像信息确定第一黑切彩阈值因子。
步骤403,根据设备增益和补光灯强度,确定第二黑切彩阈值因子。
步骤404,根据第一黑切彩阈值因子、第二黑切彩阈值因子和当前黑切彩阈值确定新的黑切彩阈值。
步骤405,根据所述图像信息和新的黑切彩阈值,判断是否满足黑切彩条件,如果满足黑切彩条件,则控制所述摄像设备执行黑切彩操作。
一些示例性实施例中,步骤401之前,所述方法还包括:
步骤400,获取所述摄像设备的预先标定数据。
一些示例性实施例中,所述预先标定数据包括:黑切彩阈值的初始值。
一些示例性实施例中,所述预先标定数据还包括:所述摄像设备的无补光图像的第一衰减因子D0 side和所述摄像设备的无补光图像的第二衰减因子D0 corner,所述摄像设备的最强补光图像的第一衰减因子Dmax side和所述摄像设备的最强补光图像的第二衰减因子Dmax corner,以及所述摄像设备的最弱补光图像的第一衰减因子Dmin side和所述摄像设备的最弱补光图像的第二衰减因子 Dmin corner
一些示例性实施例中,所述预先标定数据还包括:预先拟合得到的衰减函数,即拟合得到该衰减函数中的常数:
Figure PCTCN2022106849-appb-000009
上述预先标定数据的计算方法可以采用前述实施例中所例举的方法,在此,不一一赘述。
一些示例性实施例中,所述图像信息包括:图像照度和图像照度影响因子。
图像照度影响因子包括:补光灯或环境照度。
一些示例性实施例中,所述图像照度影响因子根据所述摄像设备拍摄的图像信息的第一衰减因子D side、第二衰减因子D corner和预先标定数据中的D0 side和D0 side确定。
一些示例性实施例中,步骤402中根据所述图像信息确定要进行黑切彩阈值调整,包括:
在所述画面照度大于当前黑切彩阈值的情况下,所述图像信息中的画面照度影响因子为补光灯,则确定要进行黑切彩阈值调整;在所述画面照度不大于当前黑切彩阈值的情况下,不进行黑切彩阈值调整,根据当前的黑切彩阈值进行摄像设备的昼夜切换控制。
一些示例性实施例中,步骤402中根据所述图像信息确定第一黑切彩阈值因子,包括:
根据所述摄像设备拍摄的图像信息的第一衰减因子D side、第二衰减因子D corner和预先标定数据中的Dmax side、Dmin side、Dmax corner和Dmin corner,根据公式(5)确定第一黑切彩阈值因子
Figure PCTCN2022106849-appb-000010
一些示例性实施例中,步骤403中根据公式(6)确定第二黑切彩阈值因子F(L,Gain)。
一些示例性实施例中,步骤404中根据公式(7)确定新的黑切彩阈值。
本公开实施例还提供一种电子设备,如图5所示,电子设备包括:一个或多个处理器501(图5中仅示例性的示出一个处理器501);存储装置502,设置为存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上述实施例中任一所述的昼夜切换方法。
本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器实现如上述实施例中任一所述的昼夜切换方法。
本公开实施例提供的昼夜切换方案,根据拍摄图像计算第一衰减因子和第二衰减因子,进而判断当前拍摄得到的图像的画面照度是受环境影响更多,还是受补光灯影响更多,分别确定不同的黑切彩阈值,能够更准确地进行昼夜判断,适用所有带补光灯的拍摄系统。
本公开实施例提供的方案中,考虑中心区域与边缘区域的亮度均一性,以及中心点和四角位置的亮度均一性,引入了第一衰减因子和第二衰减因子,还考虑补光灯强度、设备增益的影响,动态调整黑切彩阈值,提升了黑切彩阈值的环境适应性,进而提升了昼夜切换判断的准确性。
上文中所公开方法中的全部或一些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由多个物理组件合作执行。一些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、电可擦编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、闪存或其他存储器技术、只读光盘(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Video Disc,DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以设置为存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。

Claims (10)

  1. 一种昼夜切换方法,包括:
    根据摄像设备所获取的拍摄图像确定画面照度;
    在所述画面照度大于当前黑切彩阈值的情况下,根据所述拍摄图像确定画面照度影响因子;
    在所述画面照度影响因子为环境照度的情况下,根据所述画面照度和当前的黑切彩阈值,控制所述摄像设备进行昼夜切换;
    在所述画面照度影响因子为补光灯的情况下,根据所述摄像设备的拍摄参数和所述拍摄图像,确定新的黑切彩阈值;根据所述画面照度和所述新的黑切彩阈值,控制所述摄像设备进行昼夜切换。
  2. 如权利要求1所述的方法,在所述根据所述拍摄图像确定画面照度影响因子之前,还包括:
    判断所述画面照度是否发生变化;
    响应于所述画面照度未发生变化,根据所述画面照度和当前的黑切彩阈值,控制所述摄像设备进行昼夜切换;
    所述根据所述拍摄图像确定画面照度影响因子,包括:
    响应于所述画面照度已发生变化,根据所述拍摄图像确定画面照度影响因子;
    其中,
    所述判断所述画面照度是否发生变化,包括:
    计算所述画面照度相比于上一次获取的历史画面照度的变化幅度,判断所述变化幅度是否大于或等于第一变化幅度阈值;
    所述响应于所述画面照度未发生变化,包括:
    响应于所述变化幅度小于所述第一变化幅度阈值;
    所述响应于所述画面照度已发生变化,包括:
    响应于所述变化幅度大于或等于所述第一变化幅度阈值;
    或者,
    所述判断所述画面照度是否发生变化,包括:
    计算所述画面照度相比于前N次获取的历史画面照度的平均值的变化幅度,判断所述变化幅度是否大于或等于第二变化幅度阈值;
    所述响应于所述画面照度未发生变化,包括:
    响应于所述变化幅度小于所述第二变化幅度阈值;
    所述响应于所述画面照度已发生变化,包括:
    响应于所述变化幅度大于或等于所述第二变化幅度阈值。
  3. 如权利要求1或2所述的方法,其中,所述黑切彩阈值的初始值,根据以下方法预先确定:
    在暗室场景中,所述摄像设备被设置为夜晚模式,且补光灯被打开的情况下,环境亮度被增大,在所述摄像设备获取的图像除去补光灯因素后画质满足预设画质要求的情况下,获取当前环境照度值作为所述黑切彩阈值的初始值。
  4. 如权利要求1或2所述的方法,其中,所述根据所述拍摄图像确定画面照度影响因子,包括:
    根据所述拍摄图像,确定指示所述拍摄图像的中心区域亮度和边缘区域亮度均一性的第一衰减因子;
    根据所述拍摄图像,确定指示所述拍摄图像的中心点亮度和四角位置亮度均一性的第二衰减因子;
    根据所述第一衰减因子和第二衰减因子确定所述画面照度影响因子。
  5. 如权利要求1或2所述的方法,其中,所述根据所述拍摄图像确定画面照度影响因子,包括:
    根据所述拍摄图像的中心区域亮度和边缘区域亮度,确定所述拍摄图像的第一衰减因子;
    根据所述拍摄图像的中心点亮度和四角位置亮度,确定所述拍摄图像的第二衰减因子;
    在所述拍摄图像的第一衰减因子小于预先标定的所述摄像设备的无补光图像的第一衰减因子,且所述拍摄图像的第二衰减因子小于预先标定的所述摄像设备的无补光图像的第二衰减因子的情况下,确定所述画面照度影响因子为补光灯;
    在所述拍摄图像的第一衰减因子大于或等于预先标定的所述摄像设备的无补光图像的第一衰减因子,或所述拍摄图像的第二衰减因子大于或等于预先标定的所述摄像设备的无补光图像的第二衰减因子的情况下,确定所述画面照度影响因子为环境照度。
  6. 如权利要求5述的方法,其中,
    所述拍摄图像的第一衰减因子D side根据以下方式计算:
    Figure PCTCN2022106849-appb-100001
    所述拍摄图像的第二衰减因子D corner根据以下方式计算:
    Figure PCTCN2022106849-appb-100002
    其中,所述拍摄图像被划分为m*n个块,Y ij表示第i行第j列位置的块的平均亮度,m和n均为大于1的整数。
  7. 如权利要求5述的方法,其中,所述根据所述摄像设备的拍摄参数和所述拍摄图像,确定新的黑切彩阈值,包括:
    根据所述拍摄图像的第一衰减因子、所述拍摄图像的第二衰减因子和预设的调节参数,确定第一黑切彩阈值因子;
    根据所述拍摄参数中的补光灯亮度和设备增益,确定第二黑切彩阈值因子;
    根据所述第一黑切彩阈值因子、所述第二黑切彩阈值因子和当前黑切彩阈值,确定所述新的黑切彩阈值。
  8. 如权利要求7述的方法,其中,
    所述第一黑切彩阈值因子
    Figure PCTCN2022106849-appb-100003
    根据以下公式确定:
    Figure PCTCN2022106849-appb-100004
    其中,D side为所述拍摄图像的第一衰减因子,D corner为所述拍摄图像的第二衰减因子,α为预设的调节参数,0≤α≤1;
    Dmax side为预先标定的所述摄像设备的最强补光图像的第一衰减因子,Dmin side为预先标定的所述摄像设备的最弱补光图像的第一衰减因子;
    Dmax corner为预先标定的所述摄像设备的最强补光图像的第二衰减因子,Dmin corner为预先标定的所述摄像设备的最弱补光图像的第二衰减因子;
    所述第二黑切彩阈值因子F(L,Gain)根据预先拟合得到的以下衰减函数确定:
    Figure PCTCN2022106849-appb-100005
    其中,L为补光灯亮度,Gain为设备增益;A1,A0,B1和B为预先拟合确定常数,A1<0,B>1,B1>0,A0>0;
    所述新的黑切彩阈值根据以下公式确定:
    Figure PCTCN2022106849-appb-100006
    其中,T n2d为当前黑切彩阈值,T n2d-new为所述新的黑切彩阈值。
  9. 一种电子设备,包括:
    至少一个处理器;
    存储装置,设置为存储至少一个程序;
    当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现如权利要求1-8中任一项所述的昼夜切换方法。
  10. 一种计算机可读存储介质,存储有计算机程序,其中,所述程序被处理器执行时实现如权利要求1-8中任一项所述的昼夜切换方法。
PCT/CN2022/106849 2021-08-04 2022-07-20 昼夜切换方法、电子设备和存储介质 WO2023011191A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22851905.4A EP4383739A1 (en) 2021-08-04 2022-07-20 Day-night switching method, electronic device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110892573.XA CN115914827B (zh) 2021-08-04 2021-08-04 一种昼夜切换方法、电子设备和存储介质
CN202110892573.X 2021-08-04

Publications (1)

Publication Number Publication Date
WO2023011191A1 true WO2023011191A1 (zh) 2023-02-09

Family

ID=85155137

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/106849 WO2023011191A1 (zh) 2021-08-04 2022-07-20 昼夜切换方法、电子设备和存储介质

Country Status (3)

Country Link
EP (1) EP4383739A1 (zh)
CN (1) CN115914827B (zh)
WO (1) WO2023011191A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104301616A (zh) * 2014-10-31 2015-01-21 苏州科达科技股份有限公司 一种摄像机的日切夜和夜切日模式控制方法及系统
CN110536051A (zh) * 2018-05-24 2019-12-03 佳能株式会社 摄像设备及其控制方法和存储介质
CN111669510A (zh) * 2019-03-05 2020-09-15 中科创达软件股份有限公司 一种红外补光灯控制方法及系统
CN111726514A (zh) * 2019-03-20 2020-09-29 浙江宇视科技有限公司 一种摄像机及其昼夜模式切换方法、装置、设备、介质
CN112672042A (zh) * 2020-12-15 2021-04-16 浙江大华技术股份有限公司 一种摄像机日夜模式切换的方法、装置及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104301616A (zh) * 2014-10-31 2015-01-21 苏州科达科技股份有限公司 一种摄像机的日切夜和夜切日模式控制方法及系统
CN110536051A (zh) * 2018-05-24 2019-12-03 佳能株式会社 摄像设备及其控制方法和存储介质
CN111669510A (zh) * 2019-03-05 2020-09-15 中科创达软件股份有限公司 一种红外补光灯控制方法及系统
CN111726514A (zh) * 2019-03-20 2020-09-29 浙江宇视科技有限公司 一种摄像机及其昼夜模式切换方法、装置、设备、介质
CN112672042A (zh) * 2020-12-15 2021-04-16 浙江大华技术股份有限公司 一种摄像机日夜模式切换的方法、装置及存储介质

Also Published As

Publication number Publication date
CN115914827A (zh) 2023-04-04
CN115914827B (zh) 2024-05-10
EP4383739A1 (en) 2024-06-12

Similar Documents

Publication Publication Date Title
KR101812807B1 (ko) 영역별 가중치를 기반으로 한 적응형 자동 노출 제어 방법
KR100983037B1 (ko) 자동 화이트 밸런스 조정 방법
CN112752023B (zh) 一种图像调整方法、装置、电子设备及存储介质
US20060013478A1 (en) Image processing device
WO2019019904A1 (zh) 白平衡处理方法、装置和终端
US8698918B2 (en) Automatic white balancing for photography
CN106412534B (zh) 一种图像亮度调节方法及装置
US9036046B2 (en) Image processing apparatus and method with white balance correction
WO2021218603A1 (zh) 图像处理方法及投影系统
WO2020034702A1 (zh) 控制方法、装置、电子设备和计算机可读存储介质
WO2020034739A1 (zh) 控制方法、装置、电子设备和计算机可读存储介质
US9392242B2 (en) Imaging apparatus, method for controlling imaging apparatus, and storage medium, for underwater flash photography
CN113411554A (zh) 水下图像色彩还原方法和装置
JP5149055B2 (ja) 撮像装置
US20190304071A1 (en) Image processing apparatus, method for controlling the same, and recording medium
US11496694B2 (en) Dual sensor imaging system and imaging method thereof
WO2023011191A1 (zh) 昼夜切换方法、电子设备和存储介质
JP2007311895A (ja) 撮像装置、画像処理装置、画像処理方法及び画像処理プログラム
US11496660B2 (en) Dual sensor imaging system and depth map calculation method thereof
US11568526B2 (en) Dual sensor imaging system and imaging method thereof
WO2022032666A1 (zh) 处理图像的方法和相关装置
CN115914850A (zh) 增强宽动态图像通透性的方法、电子设备和存储介质
JP3958700B2 (ja) デジタルカメラ
JP2007221678A (ja) 撮像装置、画像処理装置、画像処理方法及び画像処理プログラム
US20220321764A1 (en) Illumination control device, imaging device, and storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2022851905

Country of ref document: EP

Effective date: 20240304

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22851905

Country of ref document: EP

Kind code of ref document: A1