Method, device, electronic device and computer readable storage medium for starting
By interacting with the image acquisition sensor when the camera is powered on, the main control chip dynamically acquires environmental parameters and performs initialization, thus solving the problem of unclear or overexposed images when the camera starts up, and achieving adaptive ambient lighting and fast startup.
Patent Information
- Application Number
- CN202211690280.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-12-27
AI Technical Summary
Existing video surveillance cameras suffer from problems such as unclear images or overexposure in the initial stage of image acquisition due to inaccurate ambient brightness parameters of the photosensitive element during startup.
When the camera is powered on, the main control chip interacts with the image acquisition sensor to determine its startup status. After startup, it initializes the sensor based on environmental parameters, dynamically acquires the exposure and total gain, and combines the ambient brightness with the photosensor to activate the auxiliary lighting equipment, thereby optimizing the environmental adaptability of the image acquisition sensor.
It enables the image acquisition sensor to adapt to ambient lighting during startup, improving the quality of image acquisition, shortening the camera startup time, and allowing high-quality images to be captured immediately after the application starts.
Smart Images

Figure CN116017139B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video surveillance, and in particular to a startup method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] In recent years, video surveillance systems have been widely used in industries, transportation, residential communities and other fields. Low-power battery video surveillance cameras are especially popular among consumers due to their small size, fast start-up and easy installation. For example, doorbells and peepholes with cameras can serve home security monitoring very well.
[0003] When current video surveillance cameras are started up, they generally look up the corresponding pre-stored and calibrated exposure parameters based on the ambient brightness parameters of the photosensitive element, and then set the corresponding exposure parameters to the image acquisition sensor for initialization.
[0004] However, in this method, the ambient brightness parameter of the photosensitive element is not accurate, and the search for the pre-calibrated corresponding exposure parameter based on the ambient brightness parameter cannot achieve adaptive behavior to the environment. As a result, when the image acquisition sensor performs image acquisition in the initial stage of the camera application startup, there are problems such as unclear images or overexposure. Summary of the Invention
[0005] To address the problem that cameras cannot adapt to ambient light during startup, this application provides a startup method, apparatus, electronic device, and computer-readable storage medium.
[0006] Firstly, this application provides a startup method applied to a camera, the camera including an image acquisition sensor, a main control chip, and a memory, the memory storing a boot program, the boot program including program code for initializing the image acquisition sensor, the method comprising:
[0007] When the camera is powered on, the main control chip runs the boot program to perform the following steps:
[0008] The main control chip interacts with the image acquisition sensor to determine the sensor's startup status;
[0009] When the image acquisition sensor is started up, the main control chip initializes the image acquisition sensor according to the environmental parameters, so that the image acquisition sensor can adapt to the ambient light. The environmental parameters are collected from the environment after the image acquisition sensor is started up.
[0010] In the implementation process, the starting state of the image acquisition sensor is continuously judged, and the environment parameters collected by the image acquisition sensor are dynamically acquired after the image acquisition sensor is started to initialize the image acquisition sensor, so that the image acquisition sensor can adapt to the environment light.
[0011] Further, the host chip judges the starting state of the image acquisition sensor by interacting with the image acquisition sensor, including:
[0012] The boot program continuously reads the data in the starting state register of the image acquisition sensor, and determines that the image acquisition sensor is started when the data in the starting state register changes.
[0013] In the implementation process, the boot program continuously reads the starting state of the image acquisition sensor, can timely know the data change of the starting state register of the image acquisition sensor, and thus judges the starting state of the image acquisition sensor in time and accurately.
[0014] Further, the host chip initializes the image acquisition sensor according to the environment parameters, including:
[0015] The host chip acquires the environment parameters and preset values from the image acquisition sensor.
[0016] The host chip calculates the exposure and total gain according to the environment parameters and preset values.
[0017] The host chip sends the exposure and total gain to the image acquisition sensor to complete the initialization of the image acquisition sensor.
[0018] In the implementation process, the environment parameters of the image acquisition sensor are acquired, the environment condition of the image acquisition sensor can be accurately acquired, the exposure and total gain are calculated according to the environment parameters, the calculation result is closer to the actual environment condition of the image acquisition sensor, and thus the initialization result of the image acquisition sensor can be more adaptive to the current environment.
[0019] Further, the camera further includes a photosensitive device and an auxiliary light device, and the host chip runs the boot program and further performs the following steps:
[0020] Before the host chip judges the starting state of the image acquisition sensor by interacting with the image acquisition sensor, the host chip initializes the photosensitive device.
[0021] The host chip judges whether the current environment is in daytime or nighttime according to the brightness value of the photosensitive device, and determines whether to turn on the auxiliary light device according to the current environment, or the current environment and the current working mode.
[0022] In the implementation process, the current environment is determined according to the brightness value of the light sensing device, and it is determined whether to turn on the auxiliary light device according to the current environment, so that a more appropriate environment brightness is created for the image acquisition sensor, and the image acquisition sensor can avoid too dark or too bright environment brightness, thereby improving the image quality collected by the image acquisition sensor.
[0023] Further, the boot program does not include program code for initializing other external devices except for the image acquisition sensor and the light sensing device.
[0024] In the implementation process, the unnecessary program code of the boot program is cut off, so that the boot program is more lightweight, the start speed of the camera is accelerated, and physical space is provided for the image acquisition sensor initialization program code added in the boot program.
[0025] Further, the method further comprises loading a kernel program, loading a file system and a driver system, and starting an application program of the camera, wherein the application program does not include program code for initializing the image acquisition sensor.
[0026] In the implementation process, the image acquisition sensor initialization program code in the application program is transferred to the front boot program, so that the initialization of the image acquisition sensor is completed in advance before the application program starts, and high-quality images can be captured by the image acquisition sensor without waiting after the application program starts.
[0027] Further, the camera further comprises another boot program, and the other boot program comprises initialization programs of peripherals and drivers, and the method further comprises:
[0028] When the master control chip is debugged or upgraded, the other boot program is started by the boot program.
[0029] In the implementation process, by setting two boot programs, a part of unnecessary functions, i.e. functions placed on the other boot program, can be run only when the master control chip is debugged or upgraded, so that the start speed of the camera is effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor.
[0031] Figure 1 is a flowchart of the start method provided by the first embodiment of the present application;
[0032] Figure 2 is a structural schematic diagram of a starting device provided in Embodiment Two of the present application;
[0033] Figure 3 is a structural schematic diagram of an electronic device provided in Embodiment Three of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
[0035] In order to better understand the solutions provided in the present application, a brief introduction will be given below to the prior art.
[0036] In the prior art, when video monitoring is performed, an environment parameter is read from a photosensitive device, an exposure parameter corresponding to the calibration is obtained according to the environment parameter, and the exposure parameter is transmitted to an image acquisition sensor for initialization. However, this method makes the image acquisition sensor have poor self-adaptability to the environment. Therefore, in the present application, an environment parameter is acquired from an image acquisition sensor to dynamically determine an exposure parameter, and the exposure parameter is transmitted to the image acquisition sensor for initialization, so as to improve the self-adaptability of the image acquisition sensor to the surrounding environment.
[0037] In order to better understand the solutions provided in the present application, a brief introduction will be given below to the application scenarios of the starting method provided in the present application.
[0038] When a motion target is captured by an infrared sensor of the camera, the camera is powered on, the image acquisition sensor and the main control chip are started, the main control chip runs a boot program, and the main control chip judges the starting state of the image acquisition sensor by interacting with the image acquisition sensor. When the image acquisition sensor is started, the main control chip initializes the image acquisition sensor according to an environment parameter, so that the image acquisition sensor can adapt to the environmental illumination. Of course, when the camera does not include an infrared sensor, the camera can be powered on by manual operation or other ways, such as remote control.
[0039] A specific embodiment of the present application will be described below.
[0040] Embodiment One
[0041] In order to improve the self-adaptability of the camera to the environment, the present application provides a starting method, which is applied to a camera, the camera includes an image acquisition sensor, a main control chip and a memory, the memory stores a boot program, the boot program includes program code for initializing the image acquisition sensor, and the method includes the following steps.
[0042] When the camera is powered on, the main control chip runs the boot program to perform the following steps.
[0043] S101: The host chip judges the starting state of the image acquisition sensor by interacting with the image acquisition sensor.
[0044] Specifically, the starting state of the image acquisition sensor can be judged according to the value of the starting state register thereof. Generally, when the value is 1, the starting state is not completed, and when the value becomes 0, the starting state is completed. The interaction mode of the host chip with the image acquisition sensor is not specifically limited, which can be one-way reading, bidirectional information interaction, continuous multiple reading, or periodic reading.
[0045] In an optional embodiment, the step S101 that the host chip judges the starting state of the image acquisition sensor by interacting with the image acquisition sensor includes: the boot program continuously reads the data in the starting state register of the image acquisition sensor, and when the data in the starting state register changes, it is determined that the image acquisition sensor is started.
[0046] Specifically, the boot program continuously reads the data in the starting state register of the image acquisition sensor, and judges whether the image acquisition sensor is started by comparing whether the adjacent data before and after is consistent.
[0047] In the above implementation process, the boot program can timely know the data change of the starting state register of the image acquisition sensor by continuously reading the starting state of the image acquisition sensor, so as to timely and accurately judge the starting state of the image acquisition sensor.
[0048] S102: When the image acquisition sensor is started, the host chip initializes the image acquisition sensor according to the environmental parameters, so that the image acquisition sensor can adapt to the environmental light. The environmental parameters are collected from the environment after the image acquisition sensor is started.
[0049] Specifically, the environmental parameters are parameters used for image acquisition obtained or set by the image acquisition sensor according to the environment. The environmental parameters are not specifically limited, and exemplarily can include one or more of image brightness average value, image target brightness, exposure row number, gain coefficient, and analog gain. The process of initializing the image acquisition sensor by the host chip according to the environmental parameters is not specifically limited.
[0050] In an optional embodiment, the step S102 that the host chip initializes the image acquisition sensor according to the environmental parameters includes:
[0051] S201: The host chip obtains the environmental parameters and preset values from the image acquisition sensor.
[0052] Specifically, the environmental parameters include image brightness average, image target brightness, exposure line number, gain coefficient, analog gain. The preset values include initial exposure coefficient, initial exposure amount, initial total gain, digital gain, maximum / minimum digital gain target value, digital gain precision, video frame line number, etc.
[0053] Specifically, the host chip obtains the current image brightness average from the image brightness average register LCCtrl10 of the image acquisition sensor, obtains the image target brightness from the image target brightness register LumTGT, obtains the exposure line number from the exposure amount high eight-bit register EXP_H and the exposure amount low eight-bit register EXP_L, and obtains the gain coefficient and analog gain from the gain register AGC.
[0054] S202: The host chip calculates the exposure amount and total gain according to the environmental parameters and the preset values.
[0055] Specifically, the total gain and the exposure amount can be calculated according to the following set of formulas:
[0056]
[0057] Wherein, Coef is the initial exposure coefficient, light y is the image target brightness, light a is the image brightness average, u32Coef is the exposure coefficient, exp_h is the high-bit exposure line number, exp_l is the low-bit exposure line number, shut is the initial exposure amount, u32shut is the exposure amount recalculated according to the exposure coefficient, AGain is the initial total gain, u32AGain is the finally determined total gain, Tmp is the high eight-bit of the exposure amount coefficient, IDG is the ISP digital gain, MinISPDT is the minimum ISP digital gain target value, MaxISPDT is the maximum ISP digital gain target value, ISPDS is the ISP digital gain precision; MaxExpL is the video frame line number; IExpL is the finally determined exposure amount.
[0058] S203: The host chip sends the exposure amount and the total gain to the image acquisition sensor to complete the initialization of the image acquisition sensor.
[0059] Specifically, the host chip sends the exposure amount and the total gain calculated in the above steps to the image acquisition sensor through the I2C bus to complete the initialization of the image acquisition sensor.
[0060] In the implementation process, the environment parameter is acquired from the image acquisition sensor, so that the environment condition of the image acquisition sensor can be accurately acquired, and then the exposure and the total gain are calculated in real time according to the environment parameter, so that the calculation result is closer to the actual environment condition of the image acquisition sensor, and thus the initialization result of the image acquisition sensor can be more adaptive to the current environment.
[0061] In an optional embodiment, the camera further comprises a light sensing device and an auxiliary light device, the master control chip runs the boot program and further performs the following steps:
[0062] S301: Before the master control chip judges the starting state of the image acquisition sensor by interacting with the image acquisition sensor, the master control chip initializes the light sensing device.
[0063] The light sensing device is not limited in particular and can be set according to actual conditions. For example, the light sensing device can include a photoresistor ADC or an ambient brightness sensor.
[0064] Specifically, in an optional embodiment, the light sensing device is an ambient brightness sensor, and the master control chip initializing the light sensing device includes: the master control chip setting the pin multiplexing and the register of the I2C bus of the ambient brightness sensor, and setting the trigger speed and the gain of the ambient brightness sensor through the I2C bus.
[0065] S302: The master control chip judges whether the current environment is in daytime or nighttime according to the brightness value of the light sensing device, and determines whether to turn on the auxiliary light device according to the current environment, or the current environment and the current working mode.
[0066] The current working mode is not limited in particular and can include, for example, an infrared light mode and a white light mode. The auxiliary light device is not limited in particular and can be selected according to the scene. For example, an infrared light and a white light can be selected.
[0067] Specifically, the master control chip reads the brightness value of the light sensing device through the I2C bus, judges whether the current environment is in daytime or nighttime, and determines whether to turn on the auxiliary light device in combination with the current working mode of the camera. For example, when the current environment is at night and the current working mode is the infrared light mode, the infrared light device is turned on.
[0068] In the implementation process, the current environment is judged according to the brightness value of the light sensing device, and it is determined whether to turn on the auxiliary light device according to the current environment, so that a more appropriate ambient brightness can be created for the image acquisition sensor, and the ambient brightness is prevented from being too dark or too bright, thereby improving the image quality acquired by the image acquisition sensor.
[0069] In an alternative implementation, the boot program does not include program code for initializing other external devices except for the image acquisition sensor and the light sensing device.
[0070] The other external devices are not limited, and can include an SD card device.
[0071] Specifically, the boot program provided in the embodiments of the present application only includes program code for booting and loading a system program, image acquisition sensor initialization program code, and light sensing device initialization program code, and the initialization program code of other external devices such as an SD card is deleted.
[0072] In the implementation process described above, since the boot program deletes the initialization code of other external devices, the startup speed of the camera can be accelerated. In addition, since the boot program occupies limited physical partitions, deleting the initialization code of other external devices can reserve sufficient physical space for the image acquisition sensor initialization code to run.
[0073] In an alternative implementation, the startup method provided in the present application further includes loading a kernel program, loading a file system and a driver system, and starting an application program of the camera, wherein the application program does not include program code for initializing the image acquisition sensor.
[0074] Specifically, after the boot program initializes the image acquisition sensor, the boot program further loads a kernel program, a file system and a driver system, and starts an application program of the camera. In the startup method provided in the present application, the application program of the camera does not include program code for initializing the image acquisition sensor.
[0075] Since the image acquisition sensor initialization program code in the prior art is generally located in the application program, the camera cannot immediately capture a stable image after starting the application program, and still needs to wait for a period of time to complete the initialization process of the image acquisition sensor. Therefore, the present application adds the image acquisition sensor initialization program code in the application program to the boot program, so that the image acquisition sensor has been initialized when the application program is started. In this way, a stable image can be immediately captured, and the image quality of the first several frames of images captured when the camera application program is started is improved.
[0076] In an alternative implementation, the camera further includes another boot program, and the other boot program includes initialization program code of external devices and drivers. The startup method provided in the present application further includes:
[0077] When the master control chip is debugged or upgraded, the boot program is used to guide the startup of the other boot program.
[0078] Specifically, the other boot program includes initialization programs of other external devices and drivers which are not included in the aforementioned boot program. When the master control chip is debugged or upgraded, the aforementioned boot program guides to start the initialization operation of other devices and drivers by the other boot program.
[0079] In the implementation process, by setting two boot programs, part of the unnecessary functions, i.e. the functions placed on the other boot program, can only be run when the master control chip is debugged or upgraded. The start speed of the camera is effectively improved.
[0080] Embodiment two
[0081] The application provides a starting device 200 which is applied to a camera. Figure 2 The structure diagram of the starting device 200 is shown in the figure.
[0082] When the camera is powered on, the master control chip runs the boot program which includes the following modules:
[0083] The judgment module 201 is used for the master control chip to judge the starting state of the image acquisition sensor by interacting with the image acquisition sensor.
[0084] The initialization module 202 is used for the master control chip to initialize the image acquisition sensor according to the environmental parameters when the image acquisition sensor is started, so that the image acquisition sensor can adapt to the environmental light. The environmental parameters are collected from the environment after the image acquisition sensor is started.
[0085] The judgment module 201 is specifically used for the boot program to continuously read the data in the starting state register of the image acquisition sensor. When the data in the starting state register changes, it is determined that the image acquisition sensor is started.
[0086] The initialization module 202 is specifically used for the master control chip to obtain the environmental parameters from the image acquisition sensor. The master control chip calculates the exposure and total gain according to the environmental parameters. The master control chip sends the exposure and total gain to the image acquisition sensor to complete the initialization of the image acquisition sensor.
[0087] The starting device 200 further includes a device setting module which is used for the master control chip to initialize the light sensing device. The master control chip judges whether the current environment is in daytime or night according to the brightness value of the light sensing device, and determines whether to turn on the auxiliary light device according to the current environment, or the current environment and the current working mode.
[0088] The starting device 200 further includes a system program loading module which is used for loading the kernel program, loading the file system and the driving system, and starting the application program of the camera. The application program does not include the program code for initializing the image acquisition sensor.
[0089] Embodiment three
[0090] The embodiment of the present application provides an electronic device 300, the electronic device 300 includes a master control chip 301, an image acquisition sensor 302 and a memory 303, the master control chip 301 is connected with the image acquisition sensor 302 through an I2C bus 304. The master control chip 301 is used for executing the program stored in the memory 303, so as to realize any method described in the embodiment one.
[0091] The electronic device 300 can be a camera, and the camera can further include a photosensitive device, an auxiliary light device, an extended memory card SD card and a single-chip microcomputer. The photosensitive device, the auxiliary light device, the SD card and the single-chip microcomputer are respectively connected with the master control chip through the I2C bus. The photosensitive device is used for environmental brightness sensing, the auxiliary light device is used for adjusting environmental brightness, the SD card is used for expanding the storage space of the camera, and the single-chip microcomputer is used for running a moving target monitoring program.
[0092] The embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize any method described in the embodiment one.
[0093] In the embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented by other manners. The device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and another division manner can be used in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0094] The function modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0095] The above only describes the embodiments of the present application and is not used to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A startup method, characterized in that, Applied to a camera, the camera includes an image acquisition sensor, a main control chip, and a memory. The memory stores a boot program, which includes program code for initializing the image acquisition sensor. The method includes: When the camera is powered on, the main control chip runs the boot program to perform the following steps: The main control chip determines the start-up status of the image acquisition sensor by interacting with the image acquisition sensor. When the image acquisition sensor is started up, the main control chip initializes the image acquisition sensor according to environmental parameters, so that the image acquisition sensor can adapt to ambient light. The environmental parameters are collected from the environment after the image acquisition sensor is started up. The main control chip initializes the image acquisition sensor according to environmental parameters, including: The main control chip obtains the environmental parameters and preset values from the image acquisition sensor; The main control chip calculates the exposure and total gain based on the environmental parameters and preset values; The main control chip sends the exposure amount and the total gain to the image acquisition sensor to complete the initialization of the image acquisition sensor; The environmental parameters include average image brightness, target image brightness, number of exposure lines, gain coefficient, and analog gain; the preset values include initial exposure coefficient, initial exposure amount, initial total gain, digital gain, maximum / minimum digital gain target value, digital gain accuracy, and number of video frame lines.
2. The method as described in claim 1, characterized in that, The main control chip determines the start-up status of the image acquisition sensor by interacting with the image acquisition sensor, including: The main control chip continuously reads the data in the startup status register of the image acquisition sensor through the boot program. When the data in the startup status register changes, it determines that the image acquisition sensor has completed startup.
3. The method as described in claim 1, characterized in that, The camera also includes a photosensitive device and an auxiliary lighting device. The main control chip runs the boot program and performs the following steps: Before the main control chip determines the start-up status of the image acquisition sensor by interacting with the image acquisition sensor, the main control chip initializes the photosensitive device through the boot program; The main control chip determines whether the current environment is daytime or nighttime based on the brightness value of the photosensitive device, and determines whether to turn on the auxiliary lighting device based on the current environment or the current environment and the current working mode.
4. The method as described in claim 1, characterized in that, The bootloader does not include program code for initializing other external devices besides the image acquisition sensor initialization and the photosensitive device initialization.
5. The method as described in claim 1, characterized in that, The method further includes: loading the kernel program, loading the file system and driver system, and starting the camera's application, wherein the application does not include program code for initializing the image acquisition sensor.
6. The method as described in claim 1, characterized in that, The camera also includes another bootloader, which includes initialization procedures for peripherals and drivers. The method further includes: When the main control chip is being debugged or upgraded, the bootloader will start the other bootloader.
7. A starting device, said device being applied to a camera, characterized in that, include: The judgment module is used to interact with the image acquisition sensor and determine the start-up status of the image acquisition sensor. An initialization module is used to initialize the image acquisition sensor according to environmental parameters when the image acquisition sensor has finished starting up, so that the image acquisition sensor can adapt to ambient light. The environmental parameters are acquired from the environment after the image acquisition sensor has finished starting up. The initialization module is specifically used by the main control chip to obtain the environmental parameters and preset values from the image acquisition sensor; The main control chip calculates the exposure and total gain based on the environmental parameters and preset values; The main control chip sends the exposure amount and the total gain to the image acquisition sensor to complete the initialization of the image acquisition sensor; The environmental parameters include average image brightness, target image brightness, number of exposure lines, gain coefficient, and analog gain; the preset values include initial exposure coefficient, initial exposure amount, initial total gain, digital gain, maximum / minimum digital gain target value, digital gain accuracy, and number of video frame lines.
8. An electronic device, characterized in that, include: The system includes a main control chip, an image acquisition unit, and a memory. The main control chip and the image acquisition unit are connected via a bus for communication. The main control chip is used to execute the program stored in the memory to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that can be executed by one or more processors to implement the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Method for downloading initiating program for chip, chip and liquid crystal display television
CN108513169A
Image initialization method based on user scene and camera
CN111327825A
Reversing cold start image rapid display method, computer device and computer readable storage medium
CN111746400A