WO2023093101A1 - 终端设备的模式切换方法、设备及存储介质 - Google Patents

终端设备的模式切换方法、设备及存储介质 Download PDF

Info

Publication number
WO2023093101A1
WO2023093101A1 PCT/CN2022/108316 CN2022108316W WO2023093101A1 WO 2023093101 A1 WO2023093101 A1 WO 2023093101A1 CN 2022108316 W CN2022108316 W CN 2022108316W WO 2023093101 A1 WO2023093101 A1 WO 2023093101A1
Authority
WO
WIPO (PCT)
Prior art keywords
brightness
terminal device
image
deviation value
sampling matrix
Prior art date
Application number
PCT/CN2022/108316
Other languages
English (en)
French (fr)
Inventor
邵长春
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023093101A1 publication Critical patent/WO2023093101A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/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

Definitions

  • the present disclosure relates to the technical field of terminal equipment, and in particular, to a mode switching method, equipment, and storage medium of a terminal equipment.
  • Embodiments of the present disclosure aim to provide a mode switching method, device, and storage medium of a terminal device.
  • an embodiment of the present disclosure provides a method for switching modes of a terminal device, the terminal device includes a light sensor, an infrared lamp, and an image acquisition device, and the method includes: when the terminal device is in the first working mode , to obtain the first voltage value output by the light sensor, wherein, in the first working mode, the infrared lamp is in the on state; when the first voltage value is greater than or equal to the preset first voltage value , reducing the duty cycle of the pulse waveform used to control the infrared lamp and/or increasing the shutter time of the image sensor of the terminal device; acquiring multiple images collected by the image acquisition device at different times, and determining The brightness sampling matrix of each image; according to the brightness sampling matrix of each image and the preset reference brightness sampling matrix, a brightness deviation value set is generated; when each brightness deviation value in the brightness deviation value set is greater than or when it is equal to the preset threshold, control the terminal device to be in the second working mode, wherein, in the second working mode, the infrared light is
  • an embodiment of the present disclosure further provides a terminal device, the terminal device includes a photosensitive sensor, an infrared lamp, an image acquisition device, a processor, a memory, and is stored in the memory and can be executed by the processor.
  • an embodiment of the present disclosure further provides a storage medium for computer-readable storage, the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors , so as to realize the steps of any method for switching the image acquisition mode provided in the present disclosure.
  • FIG. 1 is a schematic flowchart of a method for switching modes of a terminal device provided by an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of a scene for determining a reference luminance sampling matrix provided by an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of another scene for determining a reference luminance sampling matrix according to an embodiment of the present disclosure.
  • Fig. 4 is a schematic structural block diagram of a terminal device provided by an embodiment of the present disclosure.
  • Embodiments of the present disclosure provide a mode switching method, device, and storage medium for a terminal device.
  • 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 camera, video camera, mobile phone, tablet computer, notebook computer and desktop computer.
  • the terminal device is a camera, and when the camera is in the first working mode, the first voltage value output by the light sensor is obtained, wherein, in the first working mode, the infrared lamp is on; when the first voltage value is greater than or When it is equal to the preset first voltage value, reduce the duty cycle of the pulse waveform used to control the infrared lamp and/or increase the shutter time of the image sensor of the terminal device; acquire multiple images collected by the image acquisition device at different times, And determine the brightness sampling matrix of each image; generate a brightness deviation value set according to the brightness sampling matrix of each image and the preset reference brightness sampling matrix; when each brightness deviation value in the brightness deviation value set is greater than or equal to the preset When the threshold value is reached, the control terminal device is in the second working mode, wherein, in the second working mode, the infrared lamp is turned off.
  • FIG. 1 is a schematic flowchart of a method for switching modes of a terminal device provided by an embodiment of the present disclosure.
  • 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, acquire a first voltage value output by the light sensor, wherein, in the first working mode, the infrared light is on.
  • the light sensor is a device that converts the light intensity of the environment where the terminal device is located into an electrical signal.
  • the light sensor can be selected according to the actual situation.
  • This embodiment does not specifically limit it.
  • the light sensor can be An ambient light sensor or a photoresistor.
  • the first working mode is the working mode of the terminal device at night or when the ambient light is dark
  • the second working mode is the working mode of the terminal device in the daytime or when the ambient light is normal.
  • the terminal device is in the first working mode
  • the terminal device The infrared light in the terminal device is in the on state, and when the terminal device is in the second working mode, the infrared light in the terminal device is in the off state.
  • the infrared lamp can be set according to the actual situation, which is not specifically limited in this embodiment.
  • the light sensor when the terminal device is in the first working mode, collects the light intensity of the environment where the terminal device is located and converts the light intensity into a voltage value to obtain the voltage value output by the light sensor.
  • 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 other than the terminal device, which is not specifically limited in this embodiment.
  • the light sensor outside the terminal device collects the light intensity of the environment, converts the light intensity into a voltage value, and obtains the output voltage value of the light intensity of the environment.
  • the voltage value corresponding to the light intensity of the environment where the terminal device is located can also be accurately obtained through the light sensor outside the terminal device.
  • the terminal device 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 light sensor is obtained at a preset interval.
  • the first voltage value output by the sensor may be set according to actual conditions, which is not specifically limited in this embodiment, for example, the preset interval may be set to 30 seconds.
  • the terminal device is switched from the second mode to the first working mode or the terminal device is in the first working mode, the first voltage value output by the light sensor is obtained at intervals of preset time, which can improve the accuracy of the mode switching of the terminal device .
  • the second voltage value output by the light sensor is obtained, and when the second voltage value is less than or equal to the preset second voltage value, the terminal device is controlled to perform the first working mode, and the image acquisition device collects the current image; determine the brightness sampling matrix of the current image, and determine the brightness sampling matrix of the current image as a preset reference brightness sampling matrix.
  • the preset second voltage value can be selected according to the actual situation, for example, the preset second voltage value can be set to 0.8V
  • the image acquisition device can be selected according to the actual situation, which is not specifically limited in this embodiment
  • the image acquisition device may be a camera, and the camera may be a camera such as a monocular camera, a multi-eye camera, or a depth camera.
  • the method of determining the brightness sampling matrix of the current image may be: randomly select a plurality of pixels from the current image, obtain the brightness value corresponding to each pixel, and obtain the pixel coordinates corresponding to each brightness value, According to the pixel point coordinates, each brightness value is arranged in a matrix determinant to obtain the brightness sampling matrix of the current image.
  • the brightness values of the pixels are arranged in a matrix determinant according to the pixel coordinates of the pixels, so that the brightness sampling matrix of the current image can be accurately obtained.
  • the current image is a 4*4 image, and 8 pixels are randomly selected from the current image: the brightness value of pixel A is 20, the brightness value of pixel B is 50, and the brightness value of pixel B is 50.
  • the brightness value of C is 36
  • the brightness value of pixel D is 150
  • the brightness value of pixel E is 60
  • the brightness value of pixel F is 170
  • the brightness value of pixel G is 50
  • the brightness value of pixel H is 200.
  • the matrix is The brightness sampling matrix of the current image is Determined as a preset reference luminance sampling matrix.
  • the method of determining the brightness sampling matrix of the current image may be: select a plurality of pixel points from the current image at a preset interval of pixel points, obtain the brightness value corresponding to each pixel point, and obtain the corresponding brightness value of each pixel point.
  • each brightness value is arranged in a matrix determinant to obtain the brightness sampling matrix of the current image.
  • the preset pixel points may be set according to actual conditions, which is not specifically limited in this embodiment, for example, the number of preset pixel points may be set to 10.
  • the brightness values of the pixels are arranged in a matrix determinant according to the pixel coordinates of the pixels, so that the brightness sampling matrix of the current image can be accurately obtained.
  • the current image is a 4*4 image, and 8 pixel points are randomly selected from the current image: the brightness value of pixel point I is 200, the brightness value of pixel point J is 40, and the brightness value of pixel point J is 40.
  • the brightness value of K is 16, the brightness value of pixel M is 160, the brightness value of pixel N is 60, the brightness value of pixel O is 190, the brightness value of pixel P is 74, and the brightness value of pixel Q is 233.
  • the matrix is The brightness sampling matrix of the current image is Determined as a preset reference luminance sampling matrix.
  • Step S102 when the first voltage value is greater than or equal to the preset first voltage value, reduce the duty cycle of the pulse waveform used to control the infrared lamp and/or increase the shutter of the image sensor of the terminal device time.
  • the preset first voltage value is a threshold voltage set according to the actual situation, and the preset first voltage value can be set according to the actual situation, which is not specifically limited in this embodiment.
  • the preset first voltage value The value can be set to 1V.
  • the current duty cycle of the pulse waveform and the current shutter time of the image sensor are acquired; when the current duty cycle is greater than the preset duty cycle, the duty cycle of the pulse waveform is reduced, and the reduced duty cycle is determined Whether the lighting time corresponding to the infrared light is less than the current shutter time of the image sensor; if the lighting time of the infrared light corresponding to the reduced duty cycle is less than the current shutter time of the image sensor, adjust and reduce the duty cycle of the pulse waveform.
  • the preset duty cycle may be set according to actual conditions, which is not specifically limited in this embodiment.
  • the duty cycle may be 0.25, that is, there is a pulse waveform for 0.25 seconds within 1 second.
  • 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 0.25 is greater than the preset duty cycle 0.2
  • the duty cycle of the pulse waveform is reduced
  • the duty cycle is 0.2
  • the IR lamp lighting time corresponding to the reduced duty cycle is 0.2 seconds
  • 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 is 0.25 seconds
  • the shutter time of the image sensor of the terminal device is increased, and it is determined whether the adjusted shutter time is greater than the current duty ratio corresponding to the pulse waveform. If the adjusted shutter time is greater than the infrared lamp lighting time corresponding to the current duty cycle of the pulse waveform, stop adjusting the shutter time of the image sensor of the terminal device. By adjusting the shutter time of the image sensor, it is ensured that the image in which the infrared light is turned off can be collected, so as to improve the accuracy of switching the working mode of the terminal device.
  • 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 0.25 is smaller than the preset duty cycle 0.30
  • the current duty cycle of the pulse waveform The lighting time of the infrared lamp corresponding to the duty cycle is 0.25 seconds.
  • Increase the shutter time of the image sensor of the terminal device to 0.26.
  • the adjusted shutter time 0.26 is greater than the lighting time of the infrared lamp corresponding to the current duty cycle of the pulse waveform 0.25. Then stop adjusting the shutter time of the image sensor of the terminal device.
  • the lighting time of the infrared lamp corresponding to the reduced duty cycle is greater than or equal to the current shutter time of the image sensor, then increase the shutter time of the image sensor of the terminal device; determine that the reduced duty cycle corresponds to Whether the lighting time of the infrared light is less than the current shutter time after the increase; if the lighting time of the infrared light corresponding to the reduced duty cycle is less than the current shutter time after the increase, stop adjusting the shutter time of the image sensor of the terminal device .
  • the infrared lamp lighting time corresponding to the reduced duty cycle is 0.25 seconds, and the current shutter time of the image sensor is 0.2 seconds. Increase the shutter time of the image sensor of the terminal device to 0.30 seconds, and the reduced duty cycle If the corresponding infrared lamp lighting time is 0.25 seconds less than the adjusted current shutter time by 0.30 seconds, stop adjusting the shutter time of the image sensor of the terminal device.
  • Step S103 acquiring a plurality of images collected by the image acquisition device at different times, and determining a brightness sampling matrix of each image.
  • the image acquisition device presets Set the time for image acquisition, obtain multiple images collected at different times, acquire multiple images collected at different times, and determine the brightness sampling matrix of each image.
  • the preset time can be set according to the actual situation, which is not specifically limited in this embodiment, for example, the preset time base is 0.3 seconds.
  • the method of determining the brightness sampling matrix of each image may be: randomly select a plurality of pixels from each image, obtain the brightness value corresponding to each pixel point, and obtain the pixel point corresponding to each brightness value Coordinates, each brightness value is arranged in a matrix determinant according to the pixel coordinates, and the brightness sampling matrix of each image is obtained. According to the pixel point coordinates of the pixels, the brightness values are arranged in a matrix determinant, and the brightness sampling matrix of each image can be accurately obtained.
  • the method of determining the brightness sampling matrix of each image may be: select a plurality of pixel points from each image at a preset interval of pixel points, obtain the brightness value corresponding to each pixel point, and obtain each brightness According to the pixel coordinates corresponding to the values, each brightness value is arranged in a matrix determinant according to the pixel coordinates to obtain the brightness sampling matrix of each image.
  • the preset pixel points may be set according to actual conditions, which is not specifically limited in this embodiment, for example, the preset pixel points may be set to 10. According to the pixel point coordinates of the pixels, the brightness values are arranged in a matrix determinant, and the brightness sampling matrix of each image can be accurately obtained.
  • Step S104 generating a brightness deviation value set according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix.
  • the brightness deviation value set can be accurately generated.
  • the way to generate the brightness deviation value set may be: perform a norm operation on each brightness deviation value matrix to obtain the brightness deviation value corresponding to each brightness deviation value matrix value; collect each brightness deviation value to obtain a brightness deviation value set.
  • the brightness sampling matrix of image 1 is [8]
  • the brightness sampling matrix of image 2 is [9]
  • the brightness sampling matrix of image 3 is [13]
  • the preset reference brightness sampling matrix is [10].
  • the brightness sampling matrix [8] of image 1 the brightness sampling matrix [9] of image 2 and the brightness sampling matrix [13] of image 3 are respectively subtracted from the preset reference brightness sampling matrix [10] to obtain the brightness of image 1
  • the deviation value matrix is [-2]
  • the brightness deviation value matrix of image 2 is [-1]
  • the brightness deviation value matrix of image 3 is [3].
  • the image 2 For the brightness deviation value matrix of image 1 [-2], the image 2’s The brightness deviation value matrix [-1] and the brightness deviation value matrix [3] of image 3 perform norm operation, and the brightness deviation value of image 1 is 2, the brightness deviation value of image 2 is 1, and the brightness deviation value of image 3 is 3. Collect the brightness deviation value 2 of image 1, the brightness deviation value 1 of image 2, and the brightness deviation value 3 of image 3, and obtain the brightness deviation value set as ⁇ 2, 1, 3 ⁇ .
  • the brightness sampling matrix of image 4 is [20]
  • the brightness sampling matrix of image 5 is [19] and the brightness sampling matrix of image 6 is [32]
  • the preset reference brightness sampling matrix is [10].
  • the brightness sampling matrix [20] of image 4 the brightness sampling matrix [19] of image 5, and the brightness sampling matrix [32] of image 6 are respectively subtracted from the preset reference brightness sampling matrix [10] to obtain the brightness of image 4
  • the deviation value matrix is [10]
  • the brightness deviation value matrix of image 5 is [9]
  • the brightness deviation value matrix of image 6 is [22].
  • the brightness deviation value matrix [10] of image 4 For the brightness deviation value matrix [10] of image 4, the brightness deviation value of image 5 The matrix [9] and the brightness deviation value matrix [22] of image 6 perform norm operation, and the brightness deviation value of image 4 is 10, the brightness deviation value of image 5 is 9, and the brightness deviation value of image 6 is 22.
  • the brightness deviation value 10 of 4, the brightness deviation value 9 of image 5, and the brightness deviation value 22 of image 6 are collected, and the brightness deviation value set is ⁇ 10, 9, 22 ⁇ .
  • Step S105 When each brightness deviation value in the brightness deviation value set is greater than or equal to a preset threshold, control the terminal device to be in a second working mode, wherein, in the second working mode, the infrared Lights are off.
  • the control terminal device When at least one brightness deviation value in the set of brightness deviation values is less than or equal to the preset threshold, the control terminal device continues to be in the first working mode. When each brightness deviation value in the brightness deviation value set is greater than or equal to the preset threshold, the control terminal device is in the second working mode, wherein, in the second working mode, the infrared lamp is turned off.
  • the preset threshold may be set according to actual conditions, which is not specifically limited in this embodiment, for example, the preset threshold may be set to 2.
  • controlling the terminal device to be in the second working mode includes: turning off the infrared light, obtaining a mapping relationship table between the preset second working mode and brightness parameters, contrast parameters, saturation parameters and noise reduction ratio parameters, from Query the brightness parameter, contrast parameter, saturation parameter and noise reduction ratio parameter corresponding to the second working mode in the mapping relationship table, and control the terminal device to be in the second working mode according to the brightness parameter, contrast parameter, saturation parameter and noise reduction ratio parameter .
  • the mapping relationship table is established in advance according to the second working mode and brightness parameters, contrast parameters, saturation parameters and noise reduction ratio parameters, and the mapping relationship table can be established according to the actual situation, which is not done in the embodiment of the present application. Specific limits.
  • the brightness parameter, the contrast parameter, the saturation parameter and the noise reduction ratio parameter can be accurately and quickly determined through the mapping relationship table.
  • the first voltage value output by the light sensor is obtained, wherein, in the first working mode, the infrared lamp is in the on state;
  • the first value is greater than or equal to the preset first voltage value, reduce the duty cycle of the pulse waveform used to control the infrared lamp and/or increase the shutter time of the image sensor of the terminal device;
  • the image acquisition device acquires at different times According to the brightness sampling matrix of each image and the preset reference brightness sampling matrix, the brightness deviation value set can be accurately generated; when each brightness deviation value set When the brightness deviation values are greater than or equal to the preset threshold, the control terminal device is in the second working mode.
  • FIG. 4 is a schematic structural block diagram of a terminal device provided by an embodiment of the present disclosure.
  • the terminal device 200 includes a light sensor 201, an infrared lamp 202, an image acquisition device 203, a processor 204 and a memory 205, and a light sensor 201, an infrared lamp 202, an image acquisition device 203, a processor 204 and a memory 205 is connected via a bus 206, such as an I2C (Inter-integrated Circuit) bus.
  • a bus 206 such as an I2C (Inter-integrated Circuit) bus.
  • the processor 204 is used to provide computing and control capabilities to support the operation of the entire terminal device.
  • the processor 204 can be a central processing unit (Central Processing Unit, CPU), and the processor 204 can also be other general-purpose processors, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC ), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 205 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a U disk, or a mobile hard disk.
  • FIG. 4 is only a block diagram of a partial structure related to the disclosed solution, and does not constitute a limitation on the terminal equipment to which the disclosed solution is applied.
  • the specific terminal equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
  • the processor is configured to run a computer program stored in a memory, and implement any one of the terminal device mode switching methods provided in the embodiments of the present disclosure when executing the computer program.
  • the processor is configured to run a computer program stored in the memory, and implement the following steps when executing the computer program: when the terminal device is in the first working mode, acquire the Output the first voltage value, wherein, in the first working mode, the infrared lamp is on; when the first voltage value is greater than or equal to the preset first voltage value, reduce the The duty cycle of the pulse waveform of the infrared lamp and/or increase the shutter time of the image sensor of the terminal device; acquire multiple images collected by the image acquisition device at different times, and determine the brightness of each image Sampling matrix; generate a brightness deviation value set according to the brightness sampling matrix of each image and a preset reference brightness sampling matrix; when each brightness deviation value in the brightness deviation value set is greater than or equal to a preset threshold, Controlling the terminal device to be in a second working mode, wherein, in the second working mode, the infrared light is in an off state.
  • the processor before the processor realizes the acquisition of the first voltage value output by the light sensor when the terminal device is in the first working mode, it is further configured to: acquire the light sensor The second voltage value output by the sensor, when the second voltage value is less than or equal to the preset second voltage value, control the terminal device to perform the first working mode; acquire the current image collected by the image acquisition device; determine the brightness sampling matrix of the current image, and determine the brightness sampling matrix of the current image as a preset reference brightness sampling matrix.
  • the processor when the processor realizes reducing the duty cycle of the pulse waveform used to control the infrared lamp and/or increasing the shutter time of the image sensor of the terminal device, it is used to realize: Obtain the current duty cycle of the pulse waveform and the current shutter time of the image sensor; when the current duty cycle is greater than the preset duty cycle, reduce the duty cycle of the pulse waveform, and determine the reduced Whether the lighting time of the infrared lamp corresponding to the duty cycle is less than the current shutter time of the image sensor; if the lighting time of the infrared lamp corresponding to the reduced duty cycle is less than the current shutter time of the image sensor, stop adjusting the The duty cycle of the pulse waveform.
  • the processor is further configured to: increase the shutter time of the image sensor of the terminal device when the current duty cycle is less than or equal to the preset duty cycle, and determine the shutter time after the increase Whether the shutter time is greater than the lighting time of the infrared lamp corresponding to the current duty ratio of the pulse waveform; if the adjusted shutter time is greater than the lighting time of the infrared lamp corresponding to the current duty ratio of the pulse waveform, stop the adjustment The shutter time of the image sensor of the terminal device.
  • the processor is further configured to realize: if the lighting time of the infrared lamp corresponding to the reduced duty cycle is greater than or equal to the current shutter time of the image sensor, then adjust the image of the terminal device to The shutter time of the sensor; determine whether the lighting time of the infrared light corresponding to the reduced duty cycle is less than the current shutter time after the increase; if the lighting time of the infrared light corresponding to the reduced duty cycle is less than the current shutter time after the increase time, stop adjusting the shutter time of the image sensor of the terminal device.
  • the processor when it implements the determination of the brightness sampling matrix of each of the images, it is used to: randomly select a plurality of pixel points from each of the images, and obtain the brightness of each of the images. a plurality of brightness values corresponding to the pixels, and generating a brightness sampling matrix according to the brightness values corresponding to each of the images; or, selecting a plurality of pixels from each of the images at preset intervals, Acquiring brightness values corresponding to multiple pixels of each image, and generating a brightness sampling matrix according to the brightness values corresponding to each image.
  • the processor when the processor generates the brightness deviation value set according to the brightness sampling matrix of each of the images and the preset reference brightness sampling matrix, it is used to realize: each of the images The brightness sampling matrix and the preset reference brightness sampling matrix are subjected to matrix subtraction to obtain the brightness deviation value matrix corresponding to each of the images; according to the brightness deviation value matrix corresponding to each of the images, a brightness deviation value set is generated .
  • the processor when the processor realizes generating the brightness deviation value set according to the brightness deviation value matrix corresponding to each of the images, it is used to implement: norming each brightness deviation value matrix operation to obtain the brightness deviation value corresponding to each brightness deviation value matrix; and collect each brightness deviation value to obtain a brightness deviation value set.
  • An embodiment of the present disclosure also provides a storage medium for computer-readable storage, the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following: The steps of any one image acquisition mode switching method provided in this disclosure specification.
  • the storage medium may be an internal storage unit of the terminal device described in the foregoing embodiments, such as 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 equipped on the terminal device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, Flash card (Flash Card), etc.
  • the functional modules/units in the system, and the device can be implemented as software, firmware, hardware, and an appropriate combination thereof.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components. Components cooperate to execute.
  • 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).
  • computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media.
  • Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Landscapes

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

Abstract

本公开实施例提供一种终端设备的模式切换方法、设备及存储介质,属于终端设备领域。该方法包括:当终端设备处于第一工作模式时,获取光感传感器输出的第一电压值;在电压值大于或等于预设第一电压值时,降低用于控制红外灯的脉冲波形的占空比和/或调高终端设备的图像传感器的快门时间;获取图像采集装置在不同时刻采集到的多张图像,并确定每张图像的亮度采样矩阵;根据每张图像的亮度采样矩阵和预设的基准亮度采样矩阵,生成亮度偏差值集;当亮度偏差值集中的每个亮度偏差值均大于或等于预设阈值时,控制终端设备处于第二工作模式。

Description

终端设备的模式切换方法、设备及存储介质
相关申请的交叉引用
本申请要求享有2021年11月25日提交的以下专利申请的优先权:发明名称为“终端设备的模式切换方法、设备及存储介质”、申请号为CN202111414532.6的中国专利申请,其全部内容通过引用并入本文中。
技术领域
本公开涉及终端设备技术领域,尤其涉及一种终端设备的模式切换方法、设备及存储介质。
背景技术
随着生活质量的提高,人们热衷于通过拍照和录像记录生活中的点点滴滴,而且人们对照片和录像的质量要求越来越高,夜晚拍照成为了用户特别关注点,目前夜视情况下图像传感器采集的图像已有很多图像质量优化处理方案,但是夜视切换的时间点是个难题,如何在用户不干预的情况下自动为用户识别夜视图像,并及时做图像质量优化处理,目前各种解决方案的优化改进也是当前技术演进的一个热点,例如,目前的夜视情况下根据硬件光敏电压值判断环境条件并做出采集模式切换动作,但是存在很大误识别率,导致有一定的不可靠性,比如,夜视下打开的红外灯反光到光敏器件会导致一些误判。因此,如何准确的对终端设备的工作模式进行切换是目前亟待解决的问题。
发明内容
本公开实施例在于提供一种终端设备的模式切换方法、设备及存储介质。
第一方面,本公开实施例提供一种终端设备的模式切换方法,所述终端设备包括光感传感器、红外灯和图像采集装置,所述方法包括:当所述终端设备处于第一工作模式时,获取所述光感传感器输出的第一电压值,其中,在所述第一工作模式下,所述红外灯处于开启状态;在所述第一电压值大于或等于预设第一电压值时,降低用于控制所述红外灯的脉冲波形的占空比和/或调高所述终端设备的图像传感器的快门时间;获取所述图像采集装置在不同时刻采集到的多张图像,并确定每张所述图像的亮度采样矩阵;根据每张所述图像的亮度采样 矩阵和预设的基准亮度采样矩阵,生成亮度偏差值集;当所述亮度偏差值集中的每个亮度偏差值均大于或等于预设阈值时,控制所述终端设备处于第二工作模式,其中,在所述第二工作模式下,所述红外灯处于关闭状态。
第二方面,本公开实施例还提供一种终端设备,所述终端设备包括光感传感器、红外灯、图像采集装置、处理器、存储器、存储在所述存储器上并可被所述处理器执行的计算机程序以及用于实现所述处理器和所述存储器之间的连接通信的数据总线,其中所述计算机程序被所述处理器执行时,实现如本公开说明书提供的任一项终端设备的模式切换方法的步骤。
第三方面,本公开实施例还提供一种存储介质,用于计算机可读存储,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如本公开说明书提供的任一项图像采集模式切换的方法的步骤。
附图说明
图1为本公开实施例提供的一种终端设备的模式切换方法的流程示意图;
图2为本公开实施例提供确定基准亮度采样矩阵的一场景示意图;
图3为本公开实施例提供确定基准亮度采样矩阵的另一场景示意图;以及
图4为本公开实施例提供的一种终端设备的结构示意性框图。
具体实施方式
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
应当理解,在本公开说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本公开。如在本公开说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
本公开实施例提供一种终端设备的模式切换方法、设备及存储介质。其中,该终端设备的模式切换方法可应用于终端设备中,该终端设备可以是照相机、摄像机、手机、平板电脑、 笔记本电脑和台式电脑等电子设备。例如,该终端设备为摄像机,当摄像机处于第一工作模式时,获取光感传感器输出的第一电压值,其中,在第一工作模式下,红外灯处于开启状态;在第一电压值大于或等于预设第一电压值时,降低用于控制红外灯的脉冲波形的占空比和/或调高终端设备的图像传感器的快门时间;获取图像采集装置在不同时刻采集到的多张图像,并确定每张图像的亮度采样矩阵;根据每张图像的亮度采样矩阵和预设的基准亮度采样矩阵,生成亮度偏差值集;当亮度偏差值集中的每个亮度偏差值均大于或等于预设阈值时,控制终端设备处于第二工作模式,其中,在第二工作模式下,红外灯处于关闭状态。
下面结合附图,对本公开的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
请参照图1,图1为本公开实施例提供的一种终端设备的模式切换方法的流程示意图。
如图1所示,该终端设备的模式切换方法包括步骤S101至步骤S105。
步骤S101、当所述终端设备处于第一工作模式时,获取所述光感传感器输出的第一电压值,其中,在所述第一工作模式下,所述红外灯处于开启状态。
其中,光感传感器是将终端设备所处环境的光强度转化为电信号的器件,该光感传感器可以根据实际情况进行选择,本实施例对此不做具体限定,例如,该光感传感器可以为环境光传感器或光敏电阻。第一工作模式为终端设备在夜晚或者环境光线较暗时的工作模式,第二工作模式为终端设备在白天或者环境光线正常时的工作模式,当终端设备处于第一工作模式时,终端设备中的红外灯处于开启状态,当终端设备处于第二工作模式时,终端设备中的红外灯处于关闭状态。其中,该红外灯可以根据实际情况进行设置,本实施例对此不做具体限定。
在一实施例中,当终端设备处于第一工作模式时,光感传感器采集终端设备所处环境的光强度并将光强度转化为电压值,获取光感传感器输出的电压值。通过光感传感器能够准确地得到当前所处环境的光强度对应的电压值。需要说明的是,光感传感器除了可以是终端设备中的光感传感器,也可以是终端设备之外的光感传感器,本实施例对此不做具体限定,例如,当终端设备中的光感传感器故障时,通过终端设备外的光感传感器采集环境的光强度,并将光强度转化为电压值,获取环境的光强度输出的电压值。通过终端设备外的光感传感器也能够准确的得到终端设备所处环境的光强度对应的电压值。
需要说明的是,当终端设备由第二模式切换为第一工作模式时,获取光感传感器输出的第一电压值,或者,终端设备处于第一工作模式中,以预设间隔时间获取光感传感器输出的第一电压值。其中,该预设时间可以根据实际情况进行设置,本实施例对此不做具体限定, 例如,该预设间隔时间可以设置为30秒。在终端设备由第二模式切换为第一工作模式时或者终端设备处于第一工作模式中,以间隔预设时间获取光感传感器输出的第一电压值,能够提高终端设备的模式切换的准确性。
在一实施例中,获取光感传感器输出的第二电压值,当第二电压值小于或等于预设第二电压值时,控制所述终端设备进行第一工作模式,获取图像采集装置采集到的当前图像;确定当前图像的亮度采样矩阵,并将当前图像的亮度采样矩阵确定为预设的基准亮度采样矩阵。其中,该预设第二电压值可以根据实际情况进行选择,例如,预设第二电压值可以设置为0.8V,该图像采集装置可以根据实际情况进行选择,本实施例对此不做具体限定,例如,该图像采集装置可以是摄像头,摄像头可以是单目摄像头、多目摄像头和深度摄像头等摄像头。
在一实施例中,确定当前图像的亮度采样矩阵的方式可以为:从当前图像中随机选取多个像素点,获取每个像素点对应的亮度值,获取每个亮度值对应的像素点坐标,根据像素点坐标对每个亮度值进行矩阵行列式排列,得到当前图像的亮度采样矩阵。根据像素点的像素点坐标对亮度值进行矩阵行列式排列,能够准确地得到当前图像的亮度采样矩阵。
示例性的,如图2所示,当前图像为4*4的图像,从当前图像中随机选取8个像素点:像素点A的亮度值为20、像素点B的亮度值为50、像素点C的亮度值为36、像素点D的亮度值为150、像素点E的亮度值为60、像素点F的亮度值为170、像素点G的亮度值为50和像素点H的亮度值为200,根据像素点坐标,对像素点A、像素点B、像素点C、像素点D、像素点E、像素点F、像素点G和像素点H的亮度值进行排列得到当前图像的亮度采样矩阵为
Figure PCTCN2022108316-appb-000001
将当前图像的亮度采样矩阵为
Figure PCTCN2022108316-appb-000002
确定为预设的基准亮度采样矩阵。
在一实施例中,确定当前图像的亮度采样矩阵的方式可以为:从当前图像中以预设间隔像素点选取多个像素点,获取每个像素点对应的亮度值,获取每个亮度值对应的像素点坐标,根据像素点坐标对每个亮度值进行矩阵行列式排列,得到当前图像的亮度采样矩阵。其中,预设像素点可以根据实际情况进行设置,本实施例对此不做具体限定,例如预设像素点可以设置为10个。根据像素点的像素点坐标对亮度值进行矩阵行列式排列,能够准确地得到当前图像的亮度采样矩阵。
示例性的,如图3所示,当前图像为4*4的图像,从当前图像中随机选取8个像素点:像素点I的亮度值为200、像素点J的亮度值为40、像素点K的亮度值为16、像素点M的亮度值为160、像素点N的亮度值为60、像素点O的亮度值为190、像素点P的亮度值为74和像素点Q的亮度值为233,根据像素点坐标,对像素点I、像素点J、像素点K、像素点M、 像素点N、像素点O、像素点P和像素点Q的亮度值进行排列得到当前图像的亮度采样矩阵为
Figure PCTCN2022108316-appb-000003
将当前图像的亮度采样矩阵为
Figure PCTCN2022108316-appb-000004
确定为预设的基准亮度采样矩阵。
步骤S102、在所述第一电压值大于或等于预设第一电压值时,降低用于控制所述红外灯的脉冲波形的占空比和/或调高所述终端设备的图像传感器的快门时间。
其中,预设第一电压值为根据实际情况进行设置的阈值电压,该预设第一电压值可以根据实际情况进行设置,本实施例对此不做具体限定,例如,该预设第一电压值可以设置为1V。
在一实施例中,获取脉冲波形的当前占空比和图像传感器的当前快门时间;在当前占空比大于预设占空比时,降低脉冲波形的占空比,并确定降低后的占空比对应的红外灯点亮时间是否小于图像传感器的当前快门时间;若降低后的占空比对应的红外灯点亮时间小于图像传感器的当前快门时间,则调整降低脉冲波形的占空比。其中,预设占空比可以根据实际情况进行设置,本实施例对此不做具体限定,例如,占空比可以为0.25,即在1秒内有0.25秒存在脉冲波形。通过调整脉冲波形的占空比,以确保能够采集到红外灯处于关闭状态的图像,以提高终端设备切换工作模式的准确性。
示例性的,脉冲波形的当前占空比为0.25,图像传感器的当前快门时间为0.25秒,预设占空比为0.2,当前占空比0.25大于预设占空比0.2,降低脉冲波形的占空比至0.2,降低后的占空比对应的红外灯点亮时间为0.2秒,降低后的占空比对应的红外灯点亮时间0.2秒小于图像传感器的当前快门时间0.25秒,停止调整脉冲波形的占空比。
在一实施例中,在当前占空比小于或等于预设占空比时,调高终端设备的图像传感器的快门时间,并确定调高后的快门时间是否大于脉冲波形的当前占空比对应的红外灯点亮时间;若调高后的快门时间大于所述脉冲波形的当前占空比对应的红外灯点亮时间,则停止调整所述终端设备的图像传感器的快门时间。通过调整图像传感器的快门时间,以确保能够采集到红外灯处于关闭状态的图像,以提高终端设备切换工作模式的准确性。
示例性的,脉冲波形的当前占空比为0.25,图像传感器的当前快门时间为0.25秒,预设占空比为0.30,当前占空比0.25小于预设占空比0.30,脉冲波形的当前占空比对应的红外灯点亮时间为0.25秒,调高终端设备的图像传感器的快门时间至0.26,调高后的快门时间0.26大于脉冲波形的当前占空比对应的红外灯点亮时间0.25,则停止调整终端设备的图像传感器的快门时间。
在一实施例中,若降低后的占空比对应的红外灯点亮时间大于或等于图像传感器的当前快门时间,则调高终端设备的图像传感器的快门时间;确定降低后的占空比对应的红外灯点 亮时间是否小于调高后的当前快门时间;若降低后的占空比对应的红外灯点亮时间小于调高后的当前快门时间,则停止调整终端设备的图像传感器的快门时间。通过调整图像传感器的快门时间,以确保能够采集到红外灯处于关闭状态的图像,以提高终端设备切换工作模式的准确性。
示例性的,降低后的占空比对应的红外灯点亮时间为0.25秒,图像传感器的当前快门时间为0.2秒,调高终端设备的图像传感器的快门时间至0.30秒,降低后的占空比对应的红外灯点亮时间0.25秒小于调高后的当前快门时间0.30秒,则停止调整终端设备的图像传感器的快门时间。
步骤S103、获取所述图像采集装置在不同时刻采集到的多张图像,并确定每张所述图像的亮度采样矩阵。
在第一电压值大于或等于预设第一电压值时,降低用于控制红外灯的脉冲波形的占空比和/或调高终端设备的图像传感器的快门时间之后,图像采集装置以间隔预设时间进行图像采集,得到在不同时刻采集到的多张图像,获取图像在不同时刻采集到的多张图像,并确定每张图像的亮度采样矩阵。其中,该预设时间可以根据实际情况进行设置,本实施例对此不做具体限定,例如,预设时间库是0.3秒。
在一实施例中,确定每张图像的亮度采样矩阵的方式可以为:从每张图像中随机选取多个像素点,获取每个像素点对应的亮度值,获取每个亮度值对应的像素点坐标,根据像素点坐标对每个亮度值进行矩阵行列式排列,得到每张图像的亮度采样矩阵。根据像素点的像素点坐标对亮度值进行矩阵行列式排列,能够准确地得到每张图像的亮度采样矩阵。
在一实施例中,确定每张图像的亮度采样矩阵的方式可以为:从每张图像中以预设间隔像素点选取多个像素点,获取每个像素点对应的亮度值,获取每个亮度值对应的像素点坐标,根据像素点坐标对每个亮度值进行矩阵行列式排列,得到每张图像的亮度采样矩阵。其中,预设像素点可以根据实际情况进行设置,本实施例对此不做具体限定,例如预设像素点可以设置为10。根据像素点的像素点坐标对亮度值进行矩阵行列式排列,能够准确地得到每张图像的亮度采样矩阵。
步骤S104、根据每张所述图像的亮度采样矩阵和预设的基准亮度采样矩阵,生成亮度偏差值集。
将每张图像的亮度采样矩阵与预设的基准亮度采样矩阵进行矩阵减法运算,得到每张图像对应的亮度偏差值矩阵;根据每张图像对应的亮度偏差值矩阵,生成亮度偏差值集。根据每张图像的亮度采样矩阵和预设的基准亮度采样矩阵,能够准确的生成亮度偏差值集。
在一实施例中,根据每张图像对应的亮度偏差值矩阵,生成亮度偏差值集的方式可以为:对每个亮度偏差值矩阵进行范数运算,得到每个亮度偏差值矩阵对应的亮度偏差值;对每个亮度偏差值进行归集,得到亮度偏差值集。通过对亮度偏差值矩阵进行范数运算,能够准确的得到亮度偏差值矩阵对应的亮度偏差值。
示例性的,图像1的亮度采样矩阵为[8]、图像2的亮度采样矩阵为[9]和图像3的亮度采样矩阵为[13],预设的基准亮度采样矩阵为[10],将图像1的亮度采样矩阵[8]、图像2的亮度采样矩阵[9]和图像3的亮度采样矩阵[13]分别与预设的基准亮度采样矩阵[10]做减法运算,得到图像1的亮度偏差值矩阵为[-2]、图像2的亮度偏差值矩阵为[-1]、图像3的亮度偏差值矩阵为[3],对图像1的亮度偏差值矩阵[-2]、图像2的亮度偏差值矩阵[-1]、图像3的亮度偏差值矩阵[3]进行范数运算,得到图像1的亮度偏差值为2、图像2的亮度偏差值为1和图像3的亮度偏差值为3,对图像1的亮度偏差值2、图像2的亮度偏差值1和图像3的亮度偏差值3进行归集,得到亮度偏差值集为{2,1,3}。
示例性的,图像4的亮度采样矩阵为[20]、图像5的亮度采样矩阵为[19]和图像6的亮度采样矩阵为[32],预设的基准亮度采样矩阵为[10],将图像4的亮度采样矩阵[20]、图像5的亮度采样矩阵[19]和图像6的亮度采样矩阵[32]分别与预设的基准亮度采样矩阵[10]做减法运算,得到图像4的亮度偏差值矩阵为[10]、图像5的亮度偏差值矩阵为[9]、图像6的亮度偏差值矩阵为[22],对图像4的亮度偏差值矩阵[10]、图像5的亮度偏差值矩阵[9]、图像6的亮度偏差值矩阵[22]进行范数运算,得到图像4的亮度偏差值为10、图像5的亮度偏差值为9和图像6的亮度偏差值为22,对图像4的亮度偏差值10、图像5的亮度偏差值9和图像6的亮度偏差值22进行归集,得到亮度偏差值集为{10,9,22}。
步骤S105、当所述亮度偏差值集中的每个亮度偏差值均大于或等于预设阈值时,控制所述终端设备处于第二工作模式,其中,在所述第二工作模式下,所述红外灯处于关闭状态。
当亮度偏差值集中存在至少一个亮度偏差值小于等于预设阈值时,控制终端设备继续处于第一工作模式。当亮度偏差值集中的每个亮度偏差值均大于或等于预设阈值时,控制终端设备处于第二工作模式,其中,在第二工作模式下,红外灯处于关闭状态。其中,预设阈值可以根据实际情况进行设置,本实施例对此不做具体限定,例如,该预设阈值可以设置为2。
在一实施例中,控制终端设备处于第二工作模式包括:关闭红外灯,获取预设的第二工作模式与亮度参数、对比度参数、饱和度参数和降噪比参数之间映射关系表,从该映射关系表中查询第二工作模式对应的亮度参数、对比度参数、饱和度参数和降噪比参数,根据亮度参数、对比度参数、饱和度参数和降噪比参数控制终端设备处于第二工作模式。其中,该映 射关系表为预先根据第二工作模式与亮度参数、对比度参数、饱和度参数和降噪比参数建立的,该映射关系表可以根据实际情况进行建立,本申请实施例对此不做具体限定。通过该映射关系表能够准确且快速的确定亮度参数、对比度参数、饱和度参数和降噪比参数。
上述实施例中的终端设备的模式切换方法,当终端设备处于第一工作模式时,获取光感传感器输出的第一电压值,其中,在第一工作模式下,红外灯处于开启状态;在电压值第一大于或等于预设第一电压值时,降低用于控制红外灯的脉冲波形的占空比和/或调高终端设备的图像传感器的快门时间;然后获取图像采集装置在不同时刻采集到的多张图像,并确定每张图像的亮度采样矩阵;根据每张图像的亮度采样矩阵和预设的基准亮度采样矩阵,能够准确的生成亮度偏差值集;当亮度偏差值集中的每个亮度偏差值均大于或等于预设阈值时,控制终端设备处于第二工作模式。通过亮度偏差值集中的每个亮度偏差值与预设阈值的进行比较,能够准确是否对终端设备的工作模式进行切换,防止了误切换工作模式的现象,极大地提高了用户的使用体验。
请参阅图4,图4为本公开实施例提供的一种终端设备的结构示意性框图。
如图4所示,终端设备200包括光感传感器201、红外灯202、图像采集装置203、处理器204和存储器205,光感传感器201、红外灯202、图像采集装置203、处理器204和存储器205通过总线206连接,该总线比如为I2C(Inter-integrated Circuit)总线。
具体地,处理器204用于提供计算和控制能力,支撑整个终端设备的运行。处理器204可以是中央处理单元(Central Processing Unit,CPU),该处理器204还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
具体地,存储器205可以是Flash芯片、只读存储器(ROM,Read-Only Memory)磁盘、光盘、U盘或移动硬盘等。
本领域技术人员可以理解,图4中示出的结构,仅仅是与本公开方案相关的部分结构的框图,并不构成对本公开方案所应用于其上的终端设备的限定,具体的终端设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器用于运行存储在存储器中的计算机程序,并在执行所述计算机程序时实现本公开实施例提供的任意一种所述的终端设备的模式切换方法。
在一实施方式中,所述处理器用于运行存储在存储器中的计算机程序,并在执行所述计 算机程序时实现如下步骤:当所述终端设备处于第一工作模式时,获取所述光感传感器输出的第一电压值,其中,在所述第一工作模式下,所述红外灯处于开启状态;在所述第一电压值大于或等于预设第一电压值时,降低用于控制所述红外灯的脉冲波形的占空比和/或调高所述终端设备的图像传感器的快门时间;获取所述图像采集装置在不同时刻采集到的多张图像,并确定每张所述图像的亮度采样矩阵;根据每张所述图像的亮度采样矩阵和预设的基准亮度采样矩阵,生成亮度偏差值集;当所述亮度偏差值集中的每个亮度偏差值均大于或等于预设阈值时,控制所述终端设备处于第二工作模式,其中,在所述第二工作模式下,所述红外灯处于关闭状态。
在一实施例中,所述处理器在实现所述当所述终端设备处于第一工作模式时,获取所述光感传感器输出的第一电压值之前,还用于实现:获取所述光感传感器输出的第二电压值,当所述第二电压值小于或等于预设第二电压值时,控制所述终端设备进行第一工作模式;获取所述图像采集装置采集到的当前图像;确定所述当前图像的亮度采样矩阵,并将所述当前图像的亮度采样矩阵确定为预设的基准亮度采样矩阵。
在一实施例中,所述处理器在实现所述降低用于控制所述红外灯的脉冲波形的占空比和/或调高所述终端设备的图像传感器的快门时间时,用于实现:获取所述脉冲波形的当前占空比和所述图像传感器的当前快门时间;在所述当前占空比大于预设占空比时,降低所述脉冲波形的占空比,并确定降低后的占空比对应的红外灯点亮时间是否小于所述图像传感器的当前快门时间;若降低后的占空比对应的红外灯点亮时间小于所述图像传感器的当前快门时间,则停止调整所述脉冲波形的占空比。
在一实施例中,所述处理器还用于实现:在所述当前占空比小于或等于预设占空比时,调高所述终端设备的图像传感器的快门时间,并确定调高后的快门时间是否大于所述脉冲波形的当前占空比对应的红外灯点亮时间;若调高后的快门时间大于所述脉冲波形的当前占空比对应的红外灯点亮时间,则停止调整所述终端设备的图像传感器的快门时间。
在一实施例中,所述处理器还用于实现:若降低后的占空比对应的红外灯点亮时间大于或等于所述图像传感器的当前快门时间,则调高所述终端设备的图像传感器的快门时间;确定降低后的占空比对应的红外灯点亮时间是否小于调高后的当前快门时间;若降低后的占空比对应的红外灯点亮时间小于调高后的当前快门时间,则停止调整所述终端设备的图像传感器的快门时间。
在一实施例中,所述处理器在实现所述确定每张所述图像的亮度采样矩阵时,用于实现:从每张所述图像中随机选取多个像素点,获取各所述图像的多个所述像素点对应的亮度值, 并根据每张所述图像对应的所述亮度值生成亮度采样矩阵;或者,从每张所述图像中以预设间隔像素点选取多个像素点,获取各所述图像的多个所述像素点对应的亮度值,并根据每张所述图像对应的所述亮度值生成亮度采样矩阵。
在一实施例中,所述处理器在实现所述根据每张所述图像的亮度采样矩阵和预设的基准亮度采样矩阵,生成亮度偏差值集时,用于实现:将每张所述图像的亮度采样矩阵与所述预设的基准亮度采样矩阵进行矩阵减法运算,得到每张所述图像对应的亮度偏差值矩阵;根据每张所述图像对应的亮度偏差值矩阵,生成亮度偏差值集。
在一实施例中,所述处理器在实现所述根据每张所述图像对应的亮度偏差值矩阵,生成亮度偏差值集时,用于实现:对每个所述亮度偏差值矩阵进行范数运算,得到每个所述亮度偏差值矩阵对应的亮度偏差值;对每个所述亮度偏差值进行归集,得到亮度偏差值集。
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的终端设备的具体工作过程,可以参考前述终端设备的模式切换方法实施例中的对应过程,在此不再赘述。
本公开实施例还提供一种存储介质,用于计算机可读存储,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如本公开说明书提供的任一项图像采集模式切换的方法的步骤。
其中,所述存储介质可以是前述实施例所述的终端设备的内部存储单元,例如所述终端设备的硬盘或内存。所述存储介质也可以是所述终端设备的外部存储设备,例如所述终端设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、 闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
应当理解,在本公开说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本公开实施例序号仅仅为了描述,不代表实施例的优劣。以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以权利要求的保护范围为准。

Claims (10)

  1. 一种终端设备的模式切换方法,所述终端设备包括光感传感器、红外灯和图像采集装置,所述方法包括:
    当所述终端设备处于第一工作模式时,获取所述光感传感器输出的第一电压值,其中,在所述第一工作模式下,所述红外灯处于开启状态;
    在所述第一电压值大于或等于预设第一电压值时,降低用于控制所述红外灯的脉冲波形的占空比和/或调高所述终端设备的图像传感器的快门时间;
    获取所述图像采集装置在不同时刻采集到的多张图像,并确定每张所述图像的亮度采样矩阵;
    根据每张所述图像的亮度采样矩阵和预设的基准亮度采样矩阵,生成亮度偏差值集;以及
    当所述亮度偏差值集中的每个亮度偏差值均大于或等于预设阈值时,控制所述终端设备处于第二工作模式,其中,在所述第二工作模式下,所述红外灯处于关闭状态。
  2. 根据权利要求1所述的终端设备的模式切换方法,其中,所述当所述终端设备处于第一工作模式时,获取所述光感传感器输出的第一电压值之前,还包括:
    获取所述光感传感器输出的第二电压值,当所述第二电压值小于或等于预设第二电压值时,控制所述终端设备进行第一工作模式;
    获取所述图像采集装置采集到的当前图像;以及
    确定所述当前图像的亮度采样矩阵,并将所述当前图像的亮度采样矩阵确定为预设的基准亮度采样矩阵。
  3. 根据权利要求1所述的终端设备的模式切换方法,其中,所述降低用于控制所述红外灯的脉冲波形的占空比和/或调高所述终端设备的图像传感器的快门时间,包括:
    获取所述脉冲波形的当前占空比和所述图像传感器的当前快门时间;
    在所述当前占空比大于预设占空比时,降低所述脉冲波形的占空比,并确定降低后的占空比对应的红外灯点亮时间是否小于所述图像传感器的当前快门时间;以及
    若降低后的占空比对应的红外灯点亮时间小于所述图像传感器的当前快门时间,则停止调整所述脉冲波形的占空比。
  4. 根据权利要求3所述的终端设备的模式切换方法,还包括:
    在所述当前占空比小于或等于预设占空比时,调高所述终端设备的图像传感器的快门时间,并确定调高后的快门时间是否大于所述脉冲波形的当前占空比对应的红外灯点亮时间;以及
    若调高后的快门时间大于所述脉冲波形的当前占空比对应的红外灯点亮时间,则停止调整所述终端设备的图像传感器的快门时间。
  5. 根据权利要求3所述的终端设备的模式切换方法,还包括:
    若降低后的占空比对应的红外灯点亮时间大于或等于所述图像传感器的当前快门时间,则调高所述终端设备的图像传感器的快门时间;
    确定降低后的占空比对应的红外灯点亮时间是否小于调高后的当前快门时间;以及
    若降低后的占空比对应的红外灯点亮时间小于调高后的当前快门时间,则停止调整所述终端设备的图像传感器的快门时间。
  6. 根据权利要求1-5中任一项所述的终端设备的模式切换方法,其中,所述确定每张所述图像的亮度采样矩阵,包括:
    从每张所述图像中随机选取多个像素点,获取各所述图像的多个所述像素点对应的亮度值,并根据每张所述图像对应的所述亮度值生成亮度采样矩阵;或者,
    从每张所述图像中以预设间隔像素点选取多个像素点,获取各所述图像的多个所述像素点对应的亮度值,并根据每张所述图像对应的所述亮度值生成亮度采样矩阵。
  7. 根据权利要求1-5中任一项所述的终端设备的模式切换方法,其中,所述根据每张所述图像的亮度采样矩阵和预设的基准亮度采样矩阵,生成亮度偏差值集,包括:
    将每张所述图像的亮度采样矩阵与预设的基准亮度采样矩阵进行矩阵减法运算,得到每张所述图像对应的亮度偏差值矩阵;以及
    根据每张所述图像对应的亮度偏差值矩阵,生成亮度偏差值集。
  8. 根据权利要求7所述的终端设备的模式切换方法,其中,所述根据每张所述图像对应的亮度偏差值矩阵,生成亮度偏差值集,包括:
    对每个所述亮度偏差值矩阵进行范数运算,得到每个所述亮度偏差值矩阵对应的亮度偏差值;以及
    对每个所述亮度偏差值进行归集,得到亮度偏差值集。
  9. 一种终端设备,所述终端设备包括光感传感器、红外灯、图像采集装置、处理器、存储器、存储在所述存储器上并可被所述处理器执行的计算机程序以及用于实现所述处理器和所述存储器之间的连接通信的数据总线,其中所述计算机程序被所述处理器执行时, 实现如权利要求1至8中任一项所述的终端设备的模式切换方法的步骤。
  10. 一种存储介质,用于计算机可读存储,其中,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现权利要求1至8中任一项所述的终端设备的模式切换方法的步骤。
PCT/CN2022/108316 2021-11-25 2022-07-27 终端设备的模式切换方法、设备及存储介质 WO2023093101A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111414532.6 2021-11-25
CN202111414532.6A CN116193248A (zh) 2021-11-25 2021-11-25 终端设备的模式切换方法、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023093101A1 true WO2023093101A1 (zh) 2023-06-01

Family

ID=86444714

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/108316 WO2023093101A1 (zh) 2021-11-25 2022-07-27 终端设备的模式切换方法、设备及存储介质

Country Status (2)

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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6069676A (en) * 1996-08-02 2000-05-30 Citizen Electronics Co., Ltd. Sequential color display device
CN103781261A (zh) * 2014-02-28 2014-05-07 深圳英飞拓科技股份有限公司 红外网络摄像机的红外灯控制方法
TW201512701A (zh) * 2013-09-24 2015-04-01 Senao Networks Inc 取像裝置及其控制方法
CN107257428A (zh) * 2017-07-19 2017-10-17 上海浩创亘永科技有限公司 一种摄像头补光方法
CN111866445A (zh) * 2019-12-26 2020-10-30 北京嘀嘀无限科技发展有限公司 监控设备、方法、装置及存储介质
CN112672114A (zh) * 2020-12-21 2021-04-16 苏州科达科技股份有限公司 监控设备日夜模式的切换方法、系统、设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6069676A (en) * 1996-08-02 2000-05-30 Citizen Electronics Co., Ltd. Sequential color display device
TW201512701A (zh) * 2013-09-24 2015-04-01 Senao Networks Inc 取像裝置及其控制方法
CN103781261A (zh) * 2014-02-28 2014-05-07 深圳英飞拓科技股份有限公司 红外网络摄像机的红外灯控制方法
CN107257428A (zh) * 2017-07-19 2017-10-17 上海浩创亘永科技有限公司 一种摄像头补光方法
CN111866445A (zh) * 2019-12-26 2020-10-30 北京嘀嘀无限科技发展有限公司 监控设备、方法、装置及存储介质
CN112672114A (zh) * 2020-12-21 2021-04-16 苏州科达科技股份有限公司 监控设备日夜模式的切换方法、系统、设备及存储介质

Also Published As

Publication number Publication date
CN116193248A (zh) 2023-05-30

Similar Documents

Publication Publication Date Title
US8937677B2 (en) Digital photographing apparatus, method of controlling the same, and computer-readable medium
US9813635B2 (en) Method and apparatus for auto exposure value detection for high dynamic range imaging
US9819874B2 (en) Camera color temperature compensation system and smart terminal employing same
US8913156B2 (en) Capturing apparatus and method of capturing image
TWI530911B (zh) 動態曝光調整方法及其電子裝置
JP2020504565A (ja) カメラアセンブリおよびモバイル電子装置
US10440278B2 (en) Imaging device and system including imaging device and server
WO2019233271A1 (zh) 图像处理方法、计算机可读存储介质和电子设备
US10382734B2 (en) Electronic device and color temperature adjusting method
KR102146855B1 (ko) 촬영 설정 값을 공유하는 촬영 장치 및 방법 및 공유 시스템
WO2018121185A1 (zh) 红外灯功率的调整方法及摄像设备
US10313601B2 (en) Image capturing device and brightness adjusting method
US10834329B2 (en) Method and device for balancing foreground-background luminosity
TWI543615B (zh) 影像處理方法及其電子裝置
WO2012093519A1 (ja) 撮像装置及びその発光量制御方法
CN116055897B (zh) 拍照方法及其相关设备
US10127455B2 (en) Apparatus and method of providing thumbnail image of moving picture
US20150187056A1 (en) Electronic apparatus and image processing method
WO2018161568A1 (zh) 基于双摄像头的拍照方法及装置
CN106791451B (zh) 一种智能终端的拍照方法
US9369624B2 (en) Imaging apparatus, imaging system, imaging method, and computer program product saving program
EP2230834A1 (en) Apparatus and method for image processing
WO2023093101A1 (zh) 终端设备的模式切换方法、设备及存储介质
WO2016074414A1 (zh) 一种图像的处理方法和装置
US20190052803A1 (en) Image processing system, imaging apparatus, image processing apparatus, control method, and storage medium