CN116193248A - Mode switching method and device for terminal equipment and storage medium - Google Patents

Mode switching method and device for terminal equipment and storage medium Download PDF

Info

Publication number
CN116193248A
CN116193248A CN202111414532.6A CN202111414532A CN116193248A CN 116193248 A CN116193248 A CN 116193248A CN 202111414532 A CN202111414532 A CN 202111414532A CN 116193248 A CN116193248 A CN 116193248A
Authority
CN
China
Prior art keywords
image
brightness
terminal device
deviation value
sampling matrix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111414532.6A
Other languages
Chinese (zh)
Inventor
邵长春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN202111414532.6A priority Critical patent/CN116193248A/en
Priority to PCT/CN2022/108316 priority patent/WO2023093101A1/en
Publication of CN116193248A publication Critical patent/CN116193248A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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/73Circuitry for compensating brightness variation in the scene by influencing the exposure time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/257Picture signal generators using flying-spot scanners

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention provides a mode switching method, equipment and a storage medium of terminal equipment, belonging to the field of terminal equipment. The method comprises the following steps: when the terminal equipment is in a first working mode, a first voltage value output by the light sensor is obtained; when the voltage value is greater than or equal to a preset first voltage value, reducing the duty ratio of the pulse waveform for controlling the infrared lamp and/or increasing the shutter time of the image sensor of the terminal device; acquiring a plurality of images acquired by an image acquisition device at different moments, and determining a brightness sampling matrix of each image; generating a brightness deviation value set according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix; and when each brightness deviation value in the brightness deviation value sets is greater than or equal to a preset threshold value, controlling the terminal equipment to be in a second working mode. The scheme can accurately switch the working mode of the terminal equipment, prevents the phenomenon of mistakenly switching the working mode, and greatly improves the use experience of users.

Description

Mode switching method and device for terminal equipment and storage medium
Technical Field
The present invention relates to the field of terminal devices, and in particular, to a method, an apparatus, and a storage medium for switching modes of a terminal device.
Background
With the improvement of life quality, people are enthusiastically in recording spot drips in life through photographing and video recording, and the quality requirements of people on photographs and videos are higher and higher, photographing at night becomes a special concern for users, at present, a plurality of image quality optimization processing schemes exist for images collected by an image sensor under night vision, but the time point of night vision switching is a difficult problem, how to automatically identify night vision images for users without intervention of users and perform image quality optimization processing in time, and the optimization improvement of various solutions is also a hotspot of the current technical evolution, for example, in the existing night vision case, environmental conditions are judged according to hardware photosensitive voltage values and collection mode switching actions are performed, but a great false recognition rate exists, so that certain unreliability is caused, for example, an infrared lamp turned on under night vision reflects light to a photosensitive device, and some false judgment can be caused. Therefore, how to accurately switch the operation modes of the terminal device is a problem to be solved at present.
Disclosure of Invention
The embodiment of the invention provides a mode switching method, equipment and a storage medium of terminal equipment, aiming at improving the accuracy of the switching of the working mode of the terminal equipment.
In a first aspect, an embodiment of the present invention provides a mode switching method of a terminal device, where the terminal device includes a light sensor, an infrared lamp, and an image acquisition device, and the method includes:
when the terminal equipment is in a first working mode, a first voltage value output by the light sensor is obtained, wherein in the first working mode, the infrared lamp is in an on state;
when the first voltage value is larger than or equal to a preset first voltage value, reducing the duty ratio of a pulse waveform for controlling the infrared lamp and/or adjusting the shutter time of an image sensor of the terminal device;
acquiring a plurality of images acquired by the image acquisition device at different moments, and determining a brightness sampling matrix of each image;
generating a brightness deviation value set according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix;
and when each brightness deviation value in the brightness deviation value sets is larger than or equal to a preset threshold value, controlling the terminal equipment to be in a second working mode, wherein in the second working mode, the infrared lamp is in a closed state.
In a second aspect, an embodiment of the present invention further provides a terminal device, where the terminal device includes a light sensor, an infrared lamp, an image capturing device, a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for implementing connection communication between the processor and the memory, where the computer program, when executed by the processor, implements the steps of the mode switching method of any one of the terminal devices as provided in the specification of the present invention.
In a third aspect, embodiments of the present invention further provide a storage medium for computer readable storage, wherein the storage medium stores one or more programs executable by one or more processors to implement the steps of a method for switching between image acquisition modes as provided in the present specification.
The embodiment of the invention provides a mode switching method, equipment and a storage medium of terminal equipment, wherein when the terminal equipment is in a first working mode, a first voltage value output by a light sensor is obtained, and in the first working mode, an infrared lamp is in an on state; when the first voltage value is greater than or equal to a preset first voltage value, reducing the duty ratio of pulse waveforms for controlling the infrared lamp and/or increasing the shutter time of an image sensor of the terminal device; then acquiring a plurality of images acquired by an image acquisition device at different moments, and determining a brightness sampling matrix of each image; according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix, a brightness deviation value set can be accurately generated; and when each brightness deviation value in the brightness deviation value sets is greater than or equal to a preset threshold value, controlling the terminal equipment to be in a second working mode. By comparing each brightness deviation value in the brightness deviation value set with a preset threshold value, whether the working mode of the terminal equipment is switched can be accurately judged, the phenomenon of error switching of the working mode is prevented, and the use experience of a user is greatly improved.
Drawings
Fig. 1 is a flow chart of a mode switching method of a terminal device according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a scene for determining a reference luminance sampling matrix according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another scenario in which a reference luminance sampling matrix is determined according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is to be understood that the terminology used in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The embodiment of the invention provides a mode switching method, equipment and storage medium of terminal equipment. The mode switching method of the terminal equipment can be applied to the terminal equipment, and the terminal equipment can be electronic equipment such as cameras, video cameras, mobile phones, tablet computers, notebook computers and desktop computers. For example, the terminal device is a camera, and when the camera is in a first working mode, a first voltage value output by the light sensor is obtained, wherein in the first working mode, the infrared lamp is in an on state; when the first voltage value is greater than or equal to a preset first voltage value, reducing the duty ratio of pulse waveforms for controlling the infrared lamp and/or increasing the shutter time of an image sensor of the terminal device; acquiring a plurality of images acquired by an image acquisition device at different moments, and determining a brightness sampling matrix of each image; generating a brightness deviation value set according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix; and when each brightness deviation value in the brightness deviation value sets is larger than or equal to a preset threshold value, controlling the terminal equipment to be in a second working mode, wherein in the second working mode, the infrared lamp is in a closed state.
Some embodiments of the present invention are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flowchart of a mode switching method of a terminal device according to an embodiment of the present invention.
As shown in fig. 1, the mode switching method of the terminal device includes steps S101 to S105.
Step S101, when the terminal device is in a first working mode, a first voltage value output by the light sensor is obtained, where in the first working mode, the infrared lamp is in an on state.
The light sensor is a device that converts light intensity of an environment where the terminal device is located into an electrical signal, and the light sensor may be selected according to practical situations, which is not specifically limited in this embodiment, and for example, the light sensor may be an ambient light sensor or a photoresistor. The first working mode is a working mode of the terminal equipment at night or when the ambient light is darker, the second working mode is a working mode of the terminal equipment at daytime or when the ambient light is normal, when the terminal equipment is in the first working mode, the infrared lamp in the terminal equipment is in an on state, and when the terminal equipment is in the second working mode, the infrared lamp in the terminal equipment is in an off state. The infrared lamp may be set according to actual situations, which is not particularly limited in this embodiment.
In an embodiment, when the terminal device is in the first working mode, the light sensor collects the light intensity of the environment where the terminal device is located and converts the light intensity into a voltage value, and the voltage value output by the light sensor is obtained. The voltage value corresponding to the light intensity of the current environment can be accurately obtained through the light sensor. The light sensor may be a light sensor in the terminal device or a light sensor outside the terminal device, and the embodiment is not limited thereto, for example, when the light sensor in the terminal device fails, the light sensor outside the terminal device collects the light intensity of the environment and converts the light intensity into a voltage value, and obtains the voltage value output by the light intensity of the environment. The voltage value corresponding to the light intensity of the environment where the terminal equipment is located can be accurately obtained through the light sensor outside the terminal equipment.
When the terminal device is switched from the second mode to the first working mode, the first voltage value output by the light sensor is obtained, or the terminal device is in the first working mode, and the first voltage value output by the light sensor is obtained at preset interval time. The preset time may be set according to practical situations, and the embodiment is not limited to this, for example, the preset interval time may be set to 30 seconds. When the terminal equipment is switched from the second mode to the first working mode or the terminal equipment is in the first working mode, the first voltage value output by the light sensor is obtained at intervals for a preset time, so that the accuracy of mode switching of the terminal equipment can be improved.
In an embodiment, a second voltage value output by the light sensor is obtained, and when the second voltage value is smaller than or equal to a preset second voltage value, the terminal equipment is controlled to perform a first working mode, and a current image acquired by the image acquisition device is obtained; and determining a brightness sampling matrix of the current image, and determining the brightness sampling matrix of the current image as a preset reference brightness sampling matrix. The preset second voltage value may be selected according to an actual situation, for example, the preset second voltage value may be set to 0.8V, the image capturing device may be selected according to an actual situation, and this embodiment is not limited specifically, for example, the image capturing device may be a camera, and the camera may be a monocular camera, a multi-eye camera, a depth camera, or the like.
In an embodiment, the manner of determining the luminance sampling matrix of the current image may be: and randomly selecting a plurality of pixel points from the current image, acquiring a brightness value corresponding to each pixel point, acquiring a pixel point coordinate corresponding to each brightness value, and performing matrix determinant arrangement on each brightness value according to the pixel point coordinates to obtain a brightness sampling matrix of the current image. And (3) performing matrix determinant arrangement on the brightness values according to pixel point coordinates of the pixel points, so that a brightness sampling matrix of the current image can be accurately obtained.
For example, as shown in fig. 2, the current image is 4*4, and 8 pixels are randomly selected from the current image: the brightness sampling matrix of the current image is obtained by arranging the brightness values of the pixel A, the pixel B, the pixel C, the pixel D, the pixel E, the pixel F, the pixel G and the pixel H according to the pixel coordinates, wherein the brightness value of the pixel A is 20, the brightness value of the pixel B is 50, the brightness value of the pixel C is 36, the brightness value of the pixel D is 150, the brightness value of the pixel E is 60, the brightness value of the pixel F is 170, the brightness value of the pixel G is 50 and the brightness value of the pixel H is 200
Figure BDA0003374747810000041
The brightness sampling matrix of the current image is +.>
Figure BDA0003374747810000042
And determining a preset reference brightness sampling matrix.
In an embodiment, the manner of determining the luminance sampling matrix of the current image may be: selecting a plurality of pixel points from the current image at preset intervals, acquiring a brightness value corresponding to each pixel point, acquiring a pixel point coordinate corresponding to each brightness value, and performing matrix determinant arrangement on each brightness value according to the pixel point coordinates to obtain a brightness sampling matrix of the current image. The preset pixels may be set according to actual situations, which is not limited in this embodiment, for example, the preset pixels may be set to 10. And (3) performing matrix determinant arrangement on the brightness values according to pixel point coordinates of the pixel points, so that a brightness sampling matrix of the current image can be accurately obtained.
As shown in fig. 3, the current image is 4*4, and 8 pixels are randomly selected from the current image: the brightness value of the pixel point I is 200, the brightness value of the pixel point J is 40, the brightness value of the pixel point K is 16, the brightness value of the pixel point M is 160, the brightness value of the pixel point N is 60, the brightness value of the pixel point O is 190, the brightness value of the pixel point P is 74 and the brightness value of the pixel point Q is 233, and according to the pixel point coordinates, the brightness values of the pixel point I, the pixel point J, the pixel point K, the pixel point M, the pixel point N, the pixel point O, the pixel point P and the pixel point Q are arranged to obtain a brightness sampling matrix of the current image
Figure BDA0003374747810000043
The brightness sampling matrix of the current image is +.>
Figure BDA0003374747810000044
And determining a preset reference brightness sampling matrix.
Step S102, when the first voltage value is larger than or equal to a preset first voltage value, the duty ratio of the pulse waveform for controlling the infrared lamp is reduced and/or the shutter time of the image sensor of the terminal device is increased.
The preset first voltage value is a threshold voltage set according to an actual situation, and may be set according to an actual situation, which is not particularly limited in this embodiment, and for example, the preset first voltage value may be set to 1V.
In one embodiment, a current duty cycle of a pulse waveform and a current shutter time of an image sensor are acquired; when the current duty ratio is larger than the preset duty ratio, the duty ratio of the pulse waveform is reduced, and whether the infrared lamp lighting time corresponding to the reduced duty ratio is smaller than the current shutter time of the image sensor is determined; and if the infrared lamp lighting time corresponding to the reduced duty ratio is smaller than the current shutter time of the image sensor, adjusting the duty ratio of the reduced pulse waveform. The preset duty ratio may be set according to practical situations, and this embodiment is not limited to this, for example, the duty ratio may be 0.25, that is, a pulse waveform exists within 1 second for 0.25 seconds. The duty ratio of the pulse waveform is adjusted to ensure that the image of the infrared lamp in the off state can be acquired, so that the accuracy of switching the working mode of the terminal equipment is improved.
Illustratively, the current duty cycle of the pulse waveform is 0.25, the current shutter time of the image sensor is 0.25 seconds, the preset duty cycle is 0.2, the current duty cycle is 0.25 more than the preset duty cycle 0.2, the duty cycle of the pulse waveform is reduced to 0.2, the infrared lamp lighting time corresponding to the reduced duty cycle is 0.2 seconds less than the current shutter time of the image sensor by 0.25 seconds, and the adjustment of the duty cycle of the pulse waveform is stopped.
In an embodiment, when the current duty cycle is smaller than or equal to the preset duty cycle, the shutter time of the image sensor of the terminal device is increased, and whether the shutter time after the increase is larger than the infrared lamp lighting time corresponding to the current duty cycle of the pulse waveform is determined; and if the shutter time after the adjustment is longer than the infrared lamp lighting time corresponding to the current duty ratio of the pulse waveform, stopping adjusting the shutter time of the image sensor of the terminal equipment. The shutter time of the image sensor is adjusted to ensure that the image of the infrared lamp in the closed state can be acquired, so that the accuracy of switching the working mode of the terminal equipment is improved.
Illustratively, the current duty cycle of the pulse waveform is 0.25, the current shutter time of the image sensor is 0.25 seconds, the preset duty cycle is 0.30, the current duty cycle is 0.25 and less than the preset duty cycle 0.30, the infrared light lighting time corresponding to the current duty cycle of the pulse waveform is 0.25 seconds, the shutter time of the image sensor of the terminal device is turned up to 0.26, the shutter time after the turning up is 0.26 is greater than the infrared light lighting time corresponding to the current duty cycle of the pulse waveform by 0.25 seconds, and then the shutter time of the image sensor of the terminal device is stopped being adjusted.
In an embodiment, if the infrared lamp lighting time corresponding to the reduced duty ratio is greater than or equal to the current shutter time of the image sensor, the shutter time of the image sensor of the terminal device is increased; determining whether the lighting time of the infrared lamp corresponding to the reduced duty ratio is smaller than the current shutter time after the adjustment; and if the lighting time of the infrared lamp corresponding to the reduced duty ratio is smaller than the current shutter time after the adjustment, stopping adjusting the shutter time of the image sensor of the terminal equipment. The shutter time of the image sensor is adjusted to ensure that the image of the infrared lamp in the closed state can be acquired, so that the accuracy of switching the working mode of the terminal equipment is improved.
For example, the reduced duty cycle corresponds to an infrared lamp lighting time of 0.25 seconds, the current shutter time of the image sensor is 0.2 seconds, the shutter time of the image sensor of the terminal device is turned up to 0.30 seconds, the reduced duty cycle corresponds to an infrared lamp lighting time of 0.25 seconds less than the current shutter time of 0.30 seconds, and the shutter time of the image sensor of the terminal device is stopped being adjusted.
Step S103, acquiring a plurality of images acquired by the image acquisition device at different moments, and determining a brightness sampling matrix of each image.
When the first voltage value is larger than or equal to a preset first voltage value, reducing the duty ratio of pulse waveforms for controlling the infrared lamps and/or increasing the shutter time of an image sensor of the terminal equipment, performing image acquisition by the image acquisition device at intervals of preset time to obtain a plurality of images acquired at different moments, acquiring the plurality of images acquired at different moments, and determining the brightness sampling matrix of each image. The preset time may be set according to practical situations, and the embodiment is not limited to this, for example, the preset time base is 0.3 seconds.
In one embodiment, the manner of determining the luminance sampling matrix for each image may be: and randomly selecting a plurality of pixel points from each image, acquiring a brightness value corresponding to each pixel point, acquiring a pixel point coordinate corresponding to each brightness value, and performing matrix determinant arrangement on each brightness value according to the pixel point coordinates to obtain a brightness sampling matrix of each image. The brightness values are arranged in matrix determinant according to the pixel point coordinates of the pixel points, and the brightness sampling matrix of each image can be accurately obtained.
In one embodiment, the manner of determining the luminance sampling matrix for each image may be: selecting a plurality of pixel points from each image at preset intervals, acquiring a brightness value corresponding to each pixel point, acquiring a pixel point coordinate corresponding to each brightness value, and performing matrix determinant arrangement on each brightness value according to the pixel point coordinates to obtain a brightness sampling matrix of each image. The preset pixel point may be set according to practical situations, which is not limited in this embodiment, for example, the preset pixel point may be set to 10. The brightness values are arranged in matrix determinant according to the pixel point coordinates of the pixel points, and the brightness sampling matrix of each image can be accurately obtained.
Step S104, according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix, a brightness deviation value set is generated.
Performing matrix subtraction operation on the brightness sampling matrix of each image and a preset reference brightness sampling matrix to obtain a brightness deviation value matrix corresponding to each image; and generating a brightness deviation value set according to the brightness deviation value matrix corresponding to each image. According to the brightness sampling matrix of each image and the preset reference brightness sampling matrix, a brightness deviation value set can be accurately generated.
In an embodiment, according to the luminance deviation value matrix corresponding to each image, the manner of generating the luminance deviation value set may be: performing norm operation on each brightness deviation value matrix to obtain a brightness deviation value corresponding to each brightness deviation value matrix; and collecting each brightness deviation value to obtain a brightness deviation value set. And carrying out norm operation on the brightness deviation value matrix to accurately obtain the brightness deviation value corresponding to the brightness deviation value matrix.
Illustratively, the luminance sampling matrix of the image 1 is [8], the luminance sampling matrix of the image 2 is [9] and the luminance sampling matrix of the image 3 is [13], the preset reference luminance sampling matrix is [10], the luminance sampling matrix of the image 1 [8], the luminance sampling matrix of the image 2 [9] and the luminance sampling matrix of the image 3 [13] are respectively subtracted from the preset reference luminance sampling matrix [10] to obtain the luminance deviation value matrix of the image 1 as [ -2], the luminance deviation value matrix of the image 2 as [ -1], the luminance deviation value matrix of the image 3 as [3], the luminance deviation value matrix of the image 1 as [ -2], the luminance deviation value matrix of the image 2 as [ -1], the luminance deviation value matrix of the image 3 as [3] are subjected to norm operation to obtain the luminance deviation value of the image 1 as 2, the luminance deviation value of the image 2 as 1 and the luminance deviation value of the image 3 as 3, and the luminance deviation value of the luminance deviation value 2 as the luminance deviation value of the image 2 as 1 and the luminance deviation value of the image 3 are collected to obtain the luminance deviation value sets {2,1,3}.
Illustratively, the luminance sampling matrix of the image 4 is [20], the luminance sampling matrix of the image 5 is [19] and the luminance sampling matrix of the image 6 is [32], the preset reference luminance sampling matrix is [10], the luminance sampling matrix of the image 4 [20], the luminance sampling matrix of the image 5 [19] and the luminance sampling matrix of the image 6 [32] are respectively subtracted from the preset reference luminance sampling matrix [10], the luminance deviation value matrix of the image 4 is [10], the luminance deviation value matrix of the image 5 is [9], the luminance deviation value matrix of the image 6 is [22], the norm calculation is performed on the luminance deviation value matrix of the image 4 [10], the luminance deviation value matrix of the image 5 [9] and the luminance deviation value matrix of the image 6 [22], the luminance deviation value of the image 4 is 10, the luminance deviation value of the image 5 is 9 and the luminance deviation value of the image 6 is 22, and the luminance deviation value sets {10,9, 22}. Are obtained.
And step 105, when each brightness deviation value in the brightness deviation value sets is greater than or equal to a preset threshold, controlling the terminal equipment to be in a second working mode, wherein in the second working mode, the infrared lamp is in a closed state.
When at least one brightness deviation value is smaller than or equal to a preset threshold value in the brightness deviation value sets, the terminal equipment is controlled to be in a first working mode continuously. And when each brightness deviation value in the brightness deviation value sets is larger than or equal to a preset threshold value, controlling the terminal equipment to be in a second working mode, wherein in the second working mode, the infrared lamp is in a closed state. The preset threshold may be set according to practical situations, and this embodiment is not limited to this, and for example, the preset threshold may be set to 2.
In an embodiment, controlling the terminal device in the second operation mode includes: and turning off the infrared lamp, acquiring a mapping relation table between a preset second working mode and brightness parameters, contrast parameters, saturation parameters and noise reduction ratio parameters, inquiring the brightness parameters, contrast parameters, saturation parameters and noise reduction ratio parameters corresponding to the second working mode from the mapping relation table, and controlling the terminal equipment to be in the second working mode according to the brightness parameters, contrast parameters, saturation parameters and noise reduction ratio parameters. The mapping relation table is established in advance according to the second working mode, the brightness parameter, the contrast parameter, the saturation parameter and the noise reduction ratio parameter, and the mapping relation table can be established according to practical situations, which is not particularly limited in the embodiment of the present application. The brightness parameter, the contrast parameter, the saturation parameter and the noise reduction ratio parameter can be accurately and rapidly determined through the mapping relation table.
In the mode switching method of the terminal device in the above embodiment, when the terminal device is in the first working mode, a first voltage value output by the light sensor is obtained, wherein in the first working mode, the infrared lamp is in an on state; when the voltage value is larger than or equal to a preset first voltage value, the duty ratio of the pulse waveform for controlling the infrared lamp is reduced and/or the shutter time of the image sensor of the terminal device is increased; then acquiring a plurality of images acquired by an image acquisition device at different moments, and determining a brightness sampling matrix of each image; according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix, a brightness deviation value set can be accurately generated; and when each brightness deviation value in the brightness deviation value sets is greater than or equal to a preset threshold value, controlling the terminal equipment to be in a second working mode. By comparing each brightness deviation value in the brightness deviation value set with a preset threshold value, whether the working mode of the terminal equipment is switched can be accurately judged, the phenomenon of error switching of the working mode is prevented, and the use experience of a user is greatly improved.
Referring to fig. 4, fig. 4 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present invention.
As shown in fig. 4, the terminal device 200 includes a light sensor 201, an infrared lamp 202, an image pickup device 203, a processor 204, and a memory 205, and the light sensor 201, the infrared lamp 202, the image pickup device 203, the processor 204, and the memory 205 are connected by a bus 206, such as an I2C (Inter-integrated Circuit) bus.
In particular, the processor 204 is configured to provide computing and control capabilities to support the operation of the overall terminal device. The processor 204 may be a central processing unit (Central Processing Unit, CPU), and the processor 204 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Specifically, the Memory 205 may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk, a removable hard disk, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 4 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and is not limiting of the terminal device to which the present inventive arrangements are applied, and that a particular terminal device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The processor is configured to run a computer program stored in the memory, and implement any one of the mode switching methods of the terminal device provided by the embodiments of the present invention when the computer program is executed.
In an embodiment, the processor is configured to run a computer program stored in a memory and to implement the following steps when the computer program is executed:
when the terminal equipment is in a first working mode, a first voltage value output by the light sensor is obtained, wherein in the first working mode, the infrared lamp is in an on state;
when the first voltage value is larger than or equal to a preset first voltage value, reducing the duty ratio of a pulse waveform for controlling the infrared lamp and/or adjusting the shutter time of an image sensor of the terminal device;
acquiring a plurality of images acquired by the image acquisition device at different moments, and determining a brightness sampling matrix of each image;
generating a brightness deviation value set according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix;
and when each brightness deviation value in the brightness deviation value sets is larger than or equal to a preset threshold value, controlling the terminal equipment to be in a second working mode, wherein in the second working mode, the infrared lamp is in a closed state.
In an embodiment, before implementing the obtaining, when the terminal device is in the first operation mode, the first voltage value output by the light sensor, the processor is further configured to implement:
acquiring a second voltage value output by the light sensor, and controlling the terminal equipment to perform a first working mode when the second voltage value is smaller than or equal to a preset second voltage value; acquiring a current image acquired by the image acquisition device;
and determining the brightness sampling matrix of the current image, and determining the brightness sampling matrix of the current image as a preset reference brightness sampling matrix.
In an embodiment, the processor, when implementing the reducing the duty cycle of the pulse waveform for controlling the infrared lamp and/or the adjusting the shutter time of the image sensor of the terminal device, is configured to implement:
acquiring a current duty cycle of the pulse waveform and a current shutter time of the image sensor;
when the current duty ratio is larger than a preset duty ratio, the duty ratio of the pulse waveform is reduced, and whether the infrared lamp lighting time corresponding to the reduced duty ratio is smaller than the current shutter time of the image sensor is determined;
and if the infrared lamp lighting time corresponding to the reduced duty ratio is smaller than the current shutter time of the image sensor, stopping adjusting the duty ratio of the pulse waveform.
In an embodiment, the processor is further configured to implement:
when the current duty ratio is smaller than or equal to a preset duty ratio, the shutter time of the image sensor of the terminal equipment is regulated up, and whether the regulated shutter time is larger than the infrared lamp lighting time corresponding to the current duty ratio of the pulse waveform is determined;
and if the shutter time after the adjustment is longer than the infrared lamp lighting time corresponding to the current duty ratio of the pulse waveform, stopping adjusting the shutter time of the image sensor of the terminal equipment.
In an embodiment, the processor is further configured to implement:
if the lighting time of the infrared lamp corresponding to the reduced duty ratio is greater than or equal to the current shutter time of the image sensor, the shutter time of the image sensor of the terminal equipment is increased;
determining whether the lighting time of the infrared lamp corresponding to the reduced duty ratio is smaller than the current shutter time after the adjustment;
and if the lighting time of the infrared lamp corresponding to the reduced duty ratio is smaller than the current shutter time after the adjustment, stopping adjusting the shutter time of the image sensor of the terminal equipment.
In an embodiment, the processor, when implementing the determining the luminance sampling matrix for each of the images, is configured to implement:
randomly selecting a plurality of pixel points from each image, acquiring brightness values corresponding to the pixel points of each image, and generating a brightness sampling matrix according to the brightness values corresponding to each image; or alternatively, the process may be performed,
selecting a plurality of pixel points from each image at preset intervals, acquiring brightness values corresponding to the pixel points of each image, and generating a brightness sampling matrix according to the brightness values corresponding to each image.
In an embodiment, the processor is configured to, when implementing the generating a brightness deviation value set according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix, implement:
performing matrix subtraction operation on the brightness sampling matrix of each image and the preset reference brightness sampling matrix to obtain a brightness deviation value matrix corresponding to each image;
and generating a brightness deviation value set according to the brightness deviation value matrix corresponding to each image.
In an embodiment, when implementing the generating a brightness deviation value set according to the brightness deviation value matrix corresponding to each image, the processor is configured to implement:
performing norm operation on each brightness deviation value matrix to obtain a brightness deviation value corresponding to each brightness deviation value matrix;
and collecting each brightness deviation value to obtain a brightness deviation value set.
It should be noted that, for convenience and brevity of description, a person skilled in the art may clearly understand that, for the specific working process of the above-described terminal device, reference may be made to a corresponding process in the foregoing embodiment of the mode switching method of the terminal device, which is not described herein again.
Embodiments of the present invention also provide a storage medium for computer readable storage storing one or more programs executable by one or more processors to implement the steps of a method for switching between image acquisition modes as provided in the present specification.
The storage medium may be an internal storage unit of the terminal device according to the foregoing embodiment, for example, a hard disk or a memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between the 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 performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, 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). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, 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 includes any information delivery media.
It should be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. A mode switching method of a terminal device, wherein the terminal device includes a light sensor, an infrared lamp, and an image acquisition device, the method comprising:
when the terminal equipment is in a first working mode, a first voltage value output by the light sensor is obtained, wherein in the first working mode, the infrared lamp is in an on state;
when the first voltage value is larger than or equal to a preset first voltage value, reducing the duty ratio of a pulse waveform for controlling the infrared lamp and/or adjusting the shutter time of an image sensor of the terminal device;
acquiring a plurality of images acquired by the image acquisition device at different moments, and determining a brightness sampling matrix of each image;
generating a brightness deviation value set according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix;
and when each brightness deviation value in the brightness deviation value sets is larger than or equal to a preset threshold value, controlling the terminal equipment to be in a second working mode, wherein in the second working mode, the infrared lamp is in a closed state.
2. The method for switching modes of a terminal device according to claim 1, wherein before obtaining the first voltage value output by the light sensor when the terminal device is in the first operation mode, the method further comprises:
acquiring a second voltage value output by the light sensor, and controlling the terminal equipment to perform a first working mode when the second voltage value is smaller than or equal to a preset second voltage value;
acquiring a current image acquired by the image acquisition device;
and determining the brightness sampling matrix of the current image, and determining the brightness sampling matrix of the current image as a preset reference brightness sampling matrix.
3. The mode switching method of a terminal device according to claim 1, wherein the reducing a duty cycle of a pulse waveform for controlling the infrared lamp and/or the turning up a shutter time of an image sensor of the terminal device includes:
acquiring a current duty cycle of the pulse waveform and a current shutter time of the image sensor;
when the current duty ratio is larger than a preset duty ratio, the duty ratio of the pulse waveform is reduced, and whether the infrared lamp lighting time corresponding to the reduced duty ratio is smaller than the current shutter time of the image sensor is determined;
and if the infrared lamp lighting time corresponding to the reduced duty ratio is smaller than the current shutter time of the image sensor, stopping adjusting the duty ratio of the pulse waveform.
4. A mode switching method of a terminal device according to claim 3, characterized in that the method further comprises:
when the current duty ratio is smaller than or equal to a preset duty ratio, the shutter time of the image sensor of the terminal equipment is regulated up, and whether the regulated shutter time is larger than the infrared lamp lighting time corresponding to the current duty ratio of the pulse waveform is determined;
and if the shutter time after the adjustment is longer than the infrared lamp lighting time corresponding to the current duty ratio of the pulse waveform, stopping adjusting the shutter time of the image sensor of the terminal equipment.
5. A mode switching method of a terminal device according to claim 3, characterized in that the method further comprises:
if the lighting time of the infrared lamp corresponding to the reduced duty ratio is greater than or equal to the current shutter time of the image sensor, the shutter time of the image sensor of the terminal equipment is increased;
determining whether the lighting time of the infrared lamp corresponding to the reduced duty ratio is smaller than the current shutter time after the adjustment;
and if the lighting time of the infrared lamp corresponding to the reduced duty ratio is smaller than the current shutter time after the adjustment, stopping adjusting the shutter time of the image sensor of the terminal equipment.
6. The method for switching modes of a terminal device according to any one of claims 1 to 5, wherein said determining a luminance sampling matrix for each of said images comprises:
randomly selecting a plurality of pixel points from each image, acquiring brightness values corresponding to the pixel points of each image, and generating a brightness sampling matrix according to the brightness values corresponding to each image; or alternatively, the process may be performed,
selecting a plurality of pixel points from each image at preset intervals, acquiring brightness values corresponding to the pixel points of each image, and generating a brightness sampling matrix according to the brightness values corresponding to each image.
7. The method for switching modes of a terminal device according to any one of claims 1 to 5, wherein generating a set of luminance deviation values from a luminance sampling matrix of each of the images and a preset reference luminance sampling matrix includes:
performing matrix subtraction operation on the brightness sampling matrix of each image and a preset reference brightness sampling matrix to obtain a brightness deviation value matrix corresponding to each image;
and generating a brightness deviation value set according to the brightness deviation value matrix corresponding to each image.
8. The method for switching modes of a terminal device according to claim 7, wherein generating a luminance deviation value set according to a luminance deviation value matrix corresponding to each image comprises:
performing norm operation on each brightness deviation value matrix to obtain a brightness deviation value corresponding to each brightness deviation value matrix;
and collecting each brightness deviation value to obtain a brightness deviation value set.
9. A terminal device, characterized in that the terminal device comprises a light-sensitive sensor, an infrared lamp, an image acquisition means, a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for enabling a connection communication between the processor and the memory, wherein the computer program, when being executed by the processor, implements the steps of the mode switching method of a terminal device according to any one of claims 1 to 8.
10. A storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs executable by one or more processors to implement the steps of the mode switching method of a terminal device of any one of claims 1 to 8.
CN202111414532.6A 2021-11-25 2021-11-25 Mode switching method and device for terminal equipment and storage medium Pending CN116193248A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111414532.6A CN116193248A (en) 2021-11-25 2021-11-25 Mode switching method and device for terminal equipment and storage medium
PCT/CN2022/108316 WO2023093101A1 (en) 2021-11-25 2022-07-27 Mode switching method for terminal device, and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111414532.6A CN116193248A (en) 2021-11-25 2021-11-25 Mode switching method and device for terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116193248A true CN116193248A (en) 2023-05-30

Family

ID=86444714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111414532.6A Pending CN116193248A (en) 2021-11-25 2021-11-25 Mode switching method and device for terminal equipment and storage medium

Country Status (2)

Country Link
CN (1) CN116193248A (en)
WO (1) WO2023093101A1 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4050802B2 (en) * 1996-08-02 2008-02-20 シチズン電子株式会社 Color display device
TW201512701A (en) * 2013-09-24 2015-04-01 Senao Networks Inc Image capturing apparatus and the control method thereof
CN103781261B (en) * 2014-02-28 2015-12-09 深圳英飞拓科技股份有限公司 The infrared lamp control method of infrared network video camera
CN107257428A (en) * 2017-07-19 2017-10-17 上海浩创亘永科技有限公司 A kind of camera light compensation method
CN111866445B (en) * 2019-12-26 2022-04-26 北京嘀嘀无限科技发展有限公司 Monitoring device, method, apparatus and storage medium
CN112672114B (en) * 2020-12-21 2023-04-07 苏州科达科技股份有限公司 Method, system, equipment and storage medium for switching day and night modes of monitoring equipment

Also Published As

Publication number Publication date
WO2023093101A1 (en) 2023-06-01

Similar Documents

Publication Publication Date Title
CN111028189B (en) Image processing method, device, storage medium and electronic equipment
CN111418201B (en) Shooting method and equipment
US9813635B2 (en) Method and apparatus for auto exposure value detection for high dynamic range imaging
KR20200017475A (en) Adjustment method, terminal device and non-transitory computer readable storage medium for automatic exposure control of the region of interest
US8913156B2 (en) Capturing apparatus and method of capturing image
CN107071272B (en) Method and device for controlling brightness of camera fill-in light and terminal
US20150054987A1 (en) Image processing apparatus, image pickup apparatus, method of controlling the image processing apparatus, and non-transitory computer-readable storage medium
US9973687B2 (en) Capturing apparatus and method for capturing images without moire pattern
US11297256B2 (en) Method and device for balancing foreground-background luminosity
CN109618102B (en) Focusing processing method and device, electronic equipment and storage medium
US9666165B2 (en) Backlight compensation method, device and terminal
CN116055897B (en) Photographing method and related equipment thereof
CN107105172B (en) Focusing method and device
US20180262667A1 (en) Image capturing device and brightness adjusting method
CN105306806A (en) Mobile terminal and photographing method thereof
US20160019681A1 (en) Image processing method and electronic device using the same
CN112261292B (en) Image acquisition method, terminal, chip and storage medium
US20170331997A1 (en) Brightness compensation method and device, and computer storage medium
JPWO2012093519A1 (en) Imaging apparatus and light emission amount control method thereof
US20200007732A1 (en) Image processing method and electronic device
US20120075495A1 (en) Electronic camera
CN116506737A (en) Method, device, equipment and storage medium for determining exposure parameters
CN116193248A (en) Mode switching method and device for terminal equipment and storage medium
US11405562B2 (en) Image processing apparatus, method of controlling the same, image capturing apparatus, and storage medium
CN105657236A (en) Image processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication