WO2021190348A1 - 图像处理方法和电子设备 - Google Patents
图像处理方法和电子设备 Download PDFInfo
- Publication number
- WO2021190348A1 WO2021190348A1 PCT/CN2021/080990 CN2021080990W WO2021190348A1 WO 2021190348 A1 WO2021190348 A1 WO 2021190348A1 CN 2021080990 W CN2021080990 W CN 2021080990W WO 2021190348 A1 WO2021190348 A1 WO 2021190348A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- frame
- electronic device
- column
- row
- image data
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 14
- 238000000034 method Methods 0.000 claims abstract description 37
- 238000012545 processing Methods 0.000 claims description 32
- 230000015654 memory Effects 0.000 claims description 23
- 230000008569 process Effects 0.000 claims description 14
- 238000003780 insertion Methods 0.000 claims description 12
- 230000037431 insertion Effects 0.000 claims description 12
- 239000011159 matrix material Substances 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 8
- 238000004891 communication Methods 0.000 description 30
- 230000006870 function Effects 0.000 description 26
- 238000007726 management method Methods 0.000 description 17
- 239000013589 supplement Substances 0.000 description 5
- 229920001621 AMOLED Polymers 0.000 description 4
- 238000012937 correction Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000010295 mobile communication Methods 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000005236 sound signal Effects 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 210000000988 bone and bone Anatomy 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000035772 mutation Effects 0.000 description 2
- 230000010355 oscillation Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 206010034960 Photophobia Diseases 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 208000013469 light sensitivity Diseases 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 239000002096 quantum dot Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/60—Extraction of image or video features relating to illumination properties, e.g. using a reflectance or lighting model
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/71—Circuitry for evaluating the brightness variation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/132—Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/172—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
- H04N23/632—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/68—Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
- H04N23/681—Motion detection
- H04N23/6811—Motion detection based on the image signal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/73—Circuitry for compensating brightness variation in the scene by influencing the exposure time
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/76—Circuitry for compensating brightness variation in the scene by influencing the image signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/95—Computational photography systems, e.g. light-field imaging systems
- H04N23/951—Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/01—Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
- H04N7/0127—Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level by changing the field or frame frequency of the incoming video signal, e.g. frame rate converter
Definitions
- This application relates to the field of terminals, and more specifically, to an image processing method and electronic equipment.
- the present application provides an image processing method and an electronic device, which help to improve the smoothness of images captured by the electronic device in a dark light scene.
- an image processing method is provided, which is applied to an electronic device with a camera, and the method includes: the electronic device detects that the ambient light brightness in the current environment is less than or equal to a first preset light brightness threshold When, the sensor of the electronic device outputs a first frame rate; the electronic device collects first video data through a camera according to the first frame rate, and the first video data includes multiple frames of images; the electronic device performs processing on the multiple frames of images Frame insertion processing is performed to obtain and save second video data, where the frame rate of the second video data is greater than the first frame rate.
- the collected video data can be inserted into the frame, so that the frame rate of the finally obtained video is greater than the frame rate of the sensor of the electronic device. , Which can improve the smoothness of the video.
- the method further includes: when the electronic device detects that the ambient light brightness in the current environment is greater than or equal to a second preset light brightness threshold, the electronic device The sensor outputs a second frame rate, the second frame rate is greater than the first frame rate; the electronic device collects third video data through a camera according to the second frame rate, and the frame rate of the third video data is equal to the second frame Rate; the electronic device saves the third video data.
- the frame rate when the electronic device detects that the light brightness is greater than the second preset light brightness threshold, the frame rate can be increased, thereby ensuring the smoothness of the collected video data.
- the second preset light brightness threshold is greater than the first preset light brightness threshold.
- the frame is dropped, and when the brightness is greater than or equal to the second brightness threshold, the frame is dropped, which ensures the oscillation between the dropped frame and the non-dropped frame.
- the multi-frame image includes the ath frame of image data and the a+1th frame of image data, and the ath frame of image data and the a+1th frame of image
- the data is a W ⁇ Z matrix, and a, W, and Z are positive integers.
- the row offset and column offset are determined by calculating the SAD values of some rows and columns in the image data of the ath frame and the image data of the a+1th frame, according to the row offset and the column offset Process the image data of the ath frame or the image data of the a+1th frame, and insert the processed image data between the image data of the ath frame and the image data of the a+1th frame, so as to improve the frame of the processed image data Rate, increase the body length of the video.
- the electronic device determines the number of row offsets and the number of column offsets according to the L SAD values and the Y SAD values, including: the electronic device The row offset number corresponding to the smallest value among the L SAD values is determined as the row offset number; the electronic device determines the column offset number corresponding to the smallest value among the Y SAD values as the column offset number.
- the method before the processed image data is obtained, the method further includes: the electronic device performs edge correction processing on the offset data.
- the offset data before the processed image data is obtained, can be edge-filled, so as to improve the image quality of the image after the frame is inserted, and avoid white edges in the image after the frame is inserted.
- the electronic device processes the a-th frame of image data or the a+1-th frame of image data according to the number of row offsets and the number of column offsets to obtain processed image data, Including: the electronic device offsets the a+1 frame data according to the row offset number and the column offset number to obtain the offset frame data; the electronic device supplements the offset data Edge processing to obtain the processed image data.
- the electronic device processes the a-th frame of image data or the a+1-th frame of image data according to the number of row offsets and the number of column offsets to obtain processed image data, Including: the electronic device performs reverse offset on the a-th frame data according to the row offset number and the column offset number to obtain the offset frame data; the electronic device supplements the offset data Edge processing to obtain the processed image data.
- the present technical solution provides an image processing device included in an electronic device, and the device has the function of realizing the first aspect and the behavior of the first electronic device in the possible implementation manners of the first aspect.
- the function can be realized by hardware, or the corresponding software can be executed by hardware.
- the hardware or software includes one or more modules or units corresponding to the above-mentioned functions.
- an electronic device including one or more processors and one or more memories.
- the one or more memories are coupled with one or more processors, and the one or more memories are used to store computer program codes.
- the computer program codes include computer instructions.
- the electronic device executes An image processing method in any possible implementation of the first aspect described above.
- the present technical solution provides a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the electronic device to execute the recommended service method in the first aspect and any one of its possible implementations. .
- the present technical solution provides a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute the recommended service method in the first aspect and any one of its possible implementations.
- Fig. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
- Fig. 2 is a software structure block diagram of an electronic device provided by an embodiment of the present application.
- Fig. 3 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
- Fig. 4 is a flow chart of a frame interpolation algorithm provided by an embodiment of the present application.
- Figure 5 is a set of GUIs provided by an embodiment of the present application.
- Fig. 6 is another set of GUIs provided by an embodiment of the present application.
- first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the present embodiment, unless otherwise specified, “plurality” means two or more.
- the method provided in the embodiments of this application can be applied to mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR)/virtual reality (VR) devices, notebook computers, ultra-mobile personal computers (ultra -Mobile personal computer (UMPC), netbook, personal digital assistant (personal digital assistant, PDA) and other electronic devices, the embodiments of this application do not impose any restrictions on the specific types of electronic devices.
- AR augmented reality
- VR virtual reality
- UMPC ultra-mobile personal computers
- PDA personal digital assistant
- FIG. 1 shows a schematic structural diagram of an electronic device 100.
- the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2.
- Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
- SIM Subscriber identification module
- the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
- the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
- the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
- the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
- the processor 110 may include one or more processing units.
- the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
- AP application processor
- modem processor modem processor
- GPU graphics processing unit
- image signal processor image signal processor
- ISP image signal processor
- controller memory
- video codec digital signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- the different processing units may be independent devices or integrated in one or more processors.
- the controller may be the nerve center and command center of the electronic device 100.
- the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
- a memory may also be provided in the processor 110 to store instructions and data.
- the memory in the processor 110 is a cache memory.
- the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
- the processor 110 may include one or more interfaces.
- the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter/receiver (universal asynchronous) interface.
- I2C integrated circuit
- I2S integrated circuit built-in audio
- PCM pulse code modulation
- PCM pulse code modulation
- UART universal asynchronous transmitter/receiver
- MIPI mobile industry processor interface
- GPIO general-purpose input/output
- SIM subscriber identity module
- USB Universal Serial Bus
- the I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
- the processor 110 may include multiple sets of I2C buses.
- the processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively through different I2C bus interfaces.
- the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the electronic device 100.
- the I2S interface can be used for audio communication.
- the processor 110 may include multiple sets of I2S buses.
- the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
- the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
- the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
- the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
- the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
- the UART interface is a universal serial data bus used for asynchronous communication.
- the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
- the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
- the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
- the audio module 170 may transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
- the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
- the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
- the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100.
- the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
- the GPIO interface can be configured through software.
- the GPIO interface can be configured as a control signal or as a data signal.
- the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
- the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
- the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
- the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect other electronic devices, such as AR devices.
- the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the electronic device 100.
- the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
- the charging management module 140 is used to receive charging input from the charger.
- the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
- the power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
- the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
- the power management module 141 may also be provided in the processor 110.
- the power management module 141 and the charging management module 140 may also be provided in the same device.
- the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
- the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
- Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
- the antenna can be used in combination with a tuning switch.
- the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
- the modem processor may include a modulator and a demodulator.
- the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
- the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
- the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
- WLAN wireless local area networks
- Wi-Fi wireless fidelity
- BT bluetooth
- global navigation satellites System (global navigation satellite system, GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions.
- the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
- the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
- the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
- the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
- the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
- the display screen 194 is used to display images, videos, and the like.
- the display screen 194 includes a display panel.
- the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
- LCD liquid crystal display
- OLED organic light-emitting diode
- active-matrix organic light-emitting diode active-matrix organic light-emitting diode
- AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
- the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
- the electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
- the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
- ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
- the ISP may be provided in the camera 193.
- the camera 193 is used to capture still images or videos.
- the object generates an optical image through the lens and is projected to the photosensitive element.
- the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
- CMOS complementary metal-oxide-semiconductor
- the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
- ISP outputs digital image signals to DSP for processing.
- DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
- the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
- Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
- Video codecs are used to compress or decompress digital video.
- the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
- MPEG moving picture experts group
- MPEG2 MPEG2, MPEG3, MPEG4, and so on.
- NPU is a neural-network (NN) computing processor.
- NN neural-network
- applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
- the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
- an external memory card such as a Micro SD card
- the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
- the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121.
- the internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store the operating system, at least one application program (such as sound playback function, image playback function, etc.) required by at least one function.
- the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
- the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
- UFS universal flash storage
- the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
- the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
- the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
- the air pressure sensor 180C is used to measure air pressure.
- the magnetic sensor 180D includes a Hall sensor.
- the electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip holster.
- the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
- the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
- LED light emitting diode
- photodiode a light detector
- the ambient light sensor 180L is used to sense the brightness of the ambient light.
- the electric fingerprint sensor 180H is used to collect fingerprints.
- the electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
- the temperature sensor 180J is used to detect temperature.
- the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy.
- Touch sensor 180K also called “touch panel”.
- the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
- the bone conduction sensor 180M can acquire vibration signals.
- the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
- the embodiment of the present application takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 by way of example.
- FIG. 2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application.
- the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
- the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
- the application layer can include a series of application packages.
- the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
- the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
- the application framework layer includes some predefined functions.
- the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
- the window manager is used to manage window programs.
- the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
- the content provider is used to store and retrieve data and make these data accessible to applications.
- the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
- the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
- the view system can be used to build applications.
- the display interface can be composed of one or more views.
- a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
- the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
- the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
- the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
- the notification manager is used to notify download completion, message reminders, and so on.
- the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
- Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
- the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
- the application layer and application framework layer run in a virtual machine.
- the virtual machine executes the java files of the application layer and the application framework layer as binary files.
- the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
- the system library can include multiple functional modules. For example: surface manager (surface manager), media library (media libraries), 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
- surface manager surface manager
- media library media libraries
- 3D graphics processing library for example: OpenGL ES
- 2D graphics engine for example: SGL
- the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
- the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
- the 2D graphics engine is a drawing engine for 2D drawing.
- the kernel layer is the layer between hardware and software.
- the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
- the device can only be accepted if the fluency is maintained above 24fps.
- the current mainstream video output frame rate is 30fps, and the maximum exposure time of the video source at this time is 33ms. If it is lower than 24fps, such as outputting a 15fps video, the maximum exposure can be increased to 66.67ms, which directly doubles the exposure time relative to 30fps. Under the same photosensitive conditions, the exposure time is twice as long. Then the brightness, clarity, noise, and color of the video will be greatly improved. But 15fps will have a very obvious freeze, which makes it unacceptable for normal users.
- an embodiment of the present application proposes an image processing method that can increase the frame rate of video output, enhance the fluency of the video, and make the fluency of the video reach a user acceptable level.
- FIG. 3 shows a schematic flowchart of an image processing method 300 provided in an embodiment of the present application. As shown in FIG. 3, the method 300 includes:
- S301 The electronic device detects the brightness of the light in the current environment.
- the actual frame rate in this application refers to the frame rate at which the sensor of the electronic device emits frames.
- the first light brightness threshold is 1 lux.
- the electronic device detects that the brightness of the light in the current environment is less than or equal to 1 lux, the electronic device can output an actual frame rate of 15 fps. Then the exposure time of each frame of the electronic device is 66.7ms.
- the electronic device collects first video data through a camera according to the first frame rate, where the first video data includes multiple frames of images.
- S304 The electronic device performs frame insertion processing on the multi-frame image to obtain second video data, where the frame rate of the second video data is greater than the first frame rate.
- the frame rate of the second video can also be referred to as the nominal frame rate.
- the actual frame rate output by the electronic device can be 15fps and the exposure time is 66.7ms
- the nominal frame rate of the second video data may be 30fps or 24fps.
- S305 The electronic device judges the relationship between the light brightness in the current environment and the second light brightness threshold.
- the second light brightness threshold is 2 lux.
- the electronic device may output the actual frame rate of 30 fps. Then the exposure time of each frame of the electronic device is 33.3 ms.
- the frame is dropped, and when the brightness is greater than or equal to the second brightness threshold, the frame is dropped, which ensures the oscillation between the dropped frame and the non-dropped frame.
- the electronic device determines in S305 that the light brightness in the current environment is less than the second light brightness threshold, the electronic device continues to perform the steps of S303-S304.
- S307 The electronic device collects third video data through the camera according to the second frame rate, and the nominal frame rate of the third video data is equal to the second frame rate.
- the electronic device collects video data through the camera according to the actual frame rate, and the video data can be inserted into the frame, thereby increasing the frame rate of the video. It can improve the fluency of users when watching videos.
- Fig. 4 shows a flow of a frame interpolation algorithm provided by an embodiment of the present application. The following takes the frame insertion between the a-th frame and the a+1-th frame as an example for description, where a is a positive integer greater than or equal to 1.
- a pixel value matrix with data of the a-th frame and the a+1-th frame being a 10 ⁇ 10 pixel value matrix is taken as an example for description.
- the resolution of the current screen is 1920 ⁇ 1080
- the a-th frame data or the a+1-th frame data collected by the camera is a 1920 ⁇ 1080 pixel value matrix.
- the a-th frame data is
- Each element in the matrix represents a pixel value.
- a pixel value of 0-9 is taken as an example for description.
- the value range of the pixel value may be 0-255.
- the a+1th frame data is
- Step 401a Determine the sum of the pixel values of each row from the Mth row to the Nth row in the data center area of the a+1th frame.
- the central area of the a+1-th frame data is the fourth row or the fifth row
- the central area of the a+1-th frame data can be selected in the fourth row or the fifth row. The following takes the selection of the central area of the fourth row as an example for description.
- the central area When selecting rows from M to N in the central area, you can select several rows from the central area upwards, and select several rows downwards. For example, you can select 2 rows up and 2 rows down from the center area, that is, select rows 2 to 6.
- the sum of the pixel values in the second row is 32
- the sum of the pixel values in the third row is 31
- the sum of the pixel values in the fourth row is 34
- the sum of the pixel values in the fifth row is 35
- the sum of the pixel values in the sixth row is 35.
- the sum of the pixel values is 35.
- Step 402a Determine the sum of pixel values of each row from row k to row k+NM in the a-th frame of data, where k is a positive integer greater than or equal to 1, k ⁇ L, and L is the limited maximum row offset Shift number.
- the sum of the pixel values of the second line in the a-th frame data when shifting upward by 0 lines, the sum of the pixel values of the second line in the a-th frame data can be selected is 36, the sum of the pixel values of the third line is 38, and the sum of the pixel values of the fourth line is 40.
- the sum of the pixel values in the 5th row is 37, and the sum of the pixel values in the 6th row is 41.
- the sum of the pixel values of the first row in the a-th frame data that can be selected is 29, the sum of the pixel values of the second row is 36, and the sum of the pixel values of the third row is 38.
- the sum of the pixel values in the 4th row is 40, and the sum of the pixel values in the 5th row is 37.
- the sum of the pixel values of the third row in the a-th frame data when shifting downward by 1 line, the sum of the pixel values of the third row in the a-th frame data can be selected is 38, the sum of the pixel values of the fourth row is 40, and the sum of the pixel values of the fifth row is 37 , The sum of the pixel values in the 6th row is 41, and the sum of the pixel values in the 7th row is 30.
- the sum of the pixel values of the 4th row in the ath frame data can be selected is 40, the sum of the pixel values of the 5th row is 37, and the sum of the pixel values of the 6th row is 41 , The sum of the pixel values in the 7th row is 30, and the sum of the pixel values in the 8th row is 40.
- step 403a the sum of the pixel values of each row of the matrix from the kth row to the k+NM row obtained in step 402a and the sum of pixel values of each row obtained in step 401a are sequentially differentiated to obtain the sum of absolute difference (SAD) , Determine the row offset corresponding to the smallest SAD value.
- SAD sum of absolute difference
- the absolute difference between the sum of the pixel values of the second row in the a-th frame data and the sum of the pixel values of the second row in the a+1-th frame data is 4;
- the absolute difference between the sum of the pixel values of the third row in the a-th frame data and the sum of the pixel values in the third row in the a+1-th frame data is 7;
- the sum of the pixel values in the fourth row in the a-th frame data and the The absolute difference of the sum of the pixel values in the 4th row in the a+1 frame data is 6;
- the absolute difference is 2;
- the absolute difference between the sum of the pixel values of the 6th row in the ath frame data and the sum of the 6th row of the a+1 frame data is 6.
- the SAD value is 25 when shifting upward by
- the absolute difference between the sum of the pixel values of the first row in the ath frame data and the sum of the pixel values of the second row in the a+1th frame data is 3;
- the absolute difference between the sum of the pixel values in the second row in the a frame data and the sum of the pixel values in the third row in the a+1 frame data is 5;
- the absolute difference of the sum of the pixel values in the 4th row in the +1 frame data is 4;
- the absolute difference of the sum of the pixel values in the 4th row in the a-th frame data and the sum of the pixel values in the 5th row in the a+1-th frame data The difference is 5;
- the absolute difference between the sum of the pixel values of the 5th row in the ath frame data and the sum of the 6th row of the a+1 frame data is 2.
- the SAD value is 19 when shifting upward by one row.
- the absolute difference between the sum of the pixel values of the third row in the a-th frame data and the sum of the pixel values of the second row in the a+1-th frame data is 6. ;
- the absolute difference between the sum of the pixel values in the fourth row of the a-th frame data and the sum of the pixel values in the third row in the a+1-th frame data is 9;
- the absolute difference of the sum of the pixel values in the 4th row in the a+1 frame data is 3;
- the absolute difference of is 6;
- the absolute difference of the sum of the pixel values of the 7th line in the ath frame data and the sum of the 6th line of the a+1 frame data is 5.
- the SAD value is 29 when shifting downward
- the absolute difference between the sum of the pixel values of the fourth row in the ath frame data and the sum of the pixel values of the second row in the a+1th frame data is 8. ;
- the absolute difference between the sum of the pixel values in the 5th row in the ath frame data and the sum of the pixel values in the 3rd row in the a+1 frame data is 6;
- the absolute difference of the sum of the pixel values in the 4th row in the a+1 frame data is 7;
- the absolute difference of is 5;
- the absolute difference of the sum of the pixel values of the 8th row in the ath frame data and the sum of the pixel values of the 6th row in the a+1th frame data is 5.
- the SAD value is the smallest when one line is shifted upward.
- the column offset can be determined through steps 401b to 403b.
- Step 401b Determine the sum of the pixel values of each column from the Pth column to the Qth column in the data central area of the a+1th frame.
- the fourth column or the fifth column may be selected as the central area of the a+1 frame data.
- the following is an example of selecting the fourth column as the central area.
- the sum of the pixel values in the second column is 31, the sum of the pixel values in the third column is 36, the sum of the pixel values in the fourth column is 30, the sum of the pixel values in the fifth column is 29, and the sum of the pixel values in the sixth column is 29.
- the sum of the pixel values is 37.
- step 401b may be the same as or different from the number of rows selected in step 401a.
- step 401b it is also possible to select one column from the center area (fourth column) to the left and one column to the right, that is, to select data from the third column to the fifth column.
- Step 402b Determine the sum of the pixel values of each column from the xth column to the x+QP column in the a-th frame data, where x is a positive integer greater than or equal to 1, x ⁇ Y, and Y is the limited maximum column deviation Shift number.
- the sum of the pixel values of the second column in the a-th frame data when shifted by 0 column to the left, the sum of the pixel values of the second column in the a-th frame data can be selected is 51, the sum of the pixel values of the third column is 28, and the sum of the pixel values of the fourth column is 48.
- the sum of the pixel values in the 5th column is 31, and the sum of the pixel values in the 6th column is 36.
- the sum of the pixel values in the first column of the a-th frame data that can be selected is 36
- the sum of the pixel values in the second column is 51
- the sum of the pixel values in the third column is Is 28
- the sum of the pixel values in the 4th column is 48
- the sum of the pixel values in the 5th column is 31.
- the sum of the pixel values in the third column of the a-th frame data when shifting by 1 column to the right, the sum of the pixel values in the third column of the a-th frame data can be selected is 28, the sum of the pixel values in the fourth column is 48, and the sum of the pixel values in the fifth column is 31 , The sum of the pixel values in the 6th column is 36, and the sum of the pixel values in the 7th column is 32.
- the sum of the pixel values in the fourth column of the a-th frame data when shifting to the right by 2 columns, the sum of the pixel values in the fourth column of the a-th frame data can be selected is 48, the sum of the pixel values in the fifth column is 31, and the sum of the pixel values in the sixth column is 36 , The sum of the pixel values in the 7th column is 32, and the sum of the pixel values in the 8th column is 27.
- step 403b the sum of pixel values in each column of the matrix from column x to column x+QP obtained in step 402b and the sum of pixel values in each column obtained in step 401b are successively differentiated to obtain the sum of absolute difference (SAD), Determine the number of column offsets corresponding to the smallest SAD value.
- SAD sum of absolute difference
- the absolute difference between the sum of the pixel values of the second column in the ath frame data and the sum of the pixel values of the second column in the a+1 frame data is 20. ;
- the absolute difference between the sum of the pixel values of the third column in the a-th frame data and the sum of the pixel values of the third column in the a+1-th frame data is 8;
- the absolute difference of the sum of the pixel values in the 4th column in the a+1 frame data is 18;
- the absolute difference of is 2;
- the absolute difference between the sum of the pixel values in the 6th column in the ath frame data and the sum of the pixel values in the 6th column in the a+1 frame data is 1.
- the absolute difference between the sum of the pixel values of the first column in the a-th frame data and the sum of the pixel values of the second column in the a+1-th frame data is 5;
- the absolute difference between the sum of the pixel values in the second column in the ath frame data and the sum of the pixel values in the third column in the a+1 frame data is 15; the sum of the pixel values in the third column in the ath frame data and the a+1
- the absolute difference of the sum of the pixel values in the 4th column in the frame data is 2; the sum of the pixel values in the 4th column in the a+1 frame data and the sum of the pixel values in the 5th column in the a+1 frame data
- the absolute difference is 19; the absolute difference between the sum of the pixel values in the 5th column in the ath frame data and the sum of the pixel values in the 6th column in the a+1 frame data is 6. Then, when one column is shifted to the left,
- the absolute difference between the sum of the pixel values in the third column in the ath frame data and the sum of the pixel values in the second column in the a+1 frame data is 3. ;
- the absolute difference between the sum of the pixel values in the fourth column of the a-th frame data and the sum of the pixel values in the third column in the a+1-th frame data is 12;
- the absolute difference of the sum of the pixel values in the 4th column in the a+1 frame data is 1;
- the absolute difference of is 7;
- the absolute difference of the sum of the pixel values of the 7th column in the ath frame data and the sum of the 6th column of the a+1 frame data is 5. Then, when one column is shifted to the right, the S
- the absolute difference between the sum of the pixel values in the fourth column in the ath frame data and the sum of the pixel values in the second column in the a+1 frame data is 17 ;
- the absolute difference between the sum of the pixel values in the fifth column of the ath frame data and the sum of the pixel values in the third column in the a+1 frame data is 5;
- the absolute difference of the sum of the pixel values in the 4th column in the a+1 frame data is 6;
- the absolute difference of is 3;
- the absolute difference of the sum of the pixel values of the 8th column in the ath frame data and the sum of the pixel values of the 6th column in the a+1th frame data is 10.
- the SAD value is the smallest when one column is shifted to the right.
- the offset corresponding to the minimum SAD value can be selected, or the offset corresponding to other SAD values can be selected to determine the row offset and column offset. Shift.
- Step 404 according to the row offset in step 403a and the column offset in step 403b, perform an overall offset on the a+1-th frame data or the a-th frame data.
- the shifted frame data can be obtained as
- the reverse offset operation can also be performed on the a-th frame image.
- the shifted frame data can be obtained as
- Step 405 Perform an edge supplement operation on the offset frame data.
- edge pixel values After the offset, some edge pixel values will be empty, and edge supplement operation is required. You can use mirroring or stretching to deal with edge abnormalities.
- a mirror image can be used to perform the edge supplement operation. You can mirror the data in the 7th row of the offset frame data to the 8th row, and mirror the data in the second column to the first column, so as to obtain the frame data after the edge correction process.
- the shifted frame data may also be stretched to handle abnormal edges. For example, if the offset frame data is
- step 405 is optional.
- step 401a the sum of the pixel values of each row from row M to row N in the central area of the a-th frame data can be selected; in step 402a, it is determined that the row k to row k in the a+1 frame The sum of the pixel values of each row in the k+NM row; in step 403a, the sum of the pixel values in each row of the matrix from the kth row to the k+NM row in the a+1 frame data and the ath frame data are obtained The sum of the pixel values of each row from the Nth row to the Mth row is sequentially differentiated, and the row offset corresponding to the minimum SAD value is determined. And follow the above steps to get the column offset corresponding to the smallest SAD value.
- the overall offset of the a-th frame data is obtained to obtain the offset frame data; or, according to the opposite direction of the row offset and the column offset, the a+1
- the frame data is shifted as a whole to obtain the shifted frame data.
- Step 406 Insert the frame data after the edge correction processing between the a-th frame data and the a+1-th frame data, so as to improve the smoothness of the video.
- Fig. 5 shows a set of graphical user interfaces (GUI) provided by an embodiment of the present application.
- GUI graphical user interfaces
- the GUI is the desktop 501 of the mobile phone.
- the mobile phone detects that the user clicks the icon 502 of the camera application (application, APP) on the desktop 501, it can start the camera application and display the GUI shown in Figure 5 (b), which can be called the shooting interface 503.
- the shooting interface 503 may include a viewing frame 504. In the preview state, the preview image can be displayed in the viewfinder frame 504 in real time.
- the mobile phone detects that the user clicks on the shooting control 506, the mobile phone performs the photographing operation and saves the captured photos.
- the photo album icon 507 After that, the photos or videos that have been taken can be displayed on the touch screen.
- the mobile phone After the mobile phone detects the user's click on the icon 502, the mobile phone opens the camera application by default in the camera mode.
- the GUI interface also includes video mode, professional mode, and more.
- the GUI is a video display interface.
- the mobile phone detects that the user clicks on the control 508, the mobile phone can display the GUI as shown in (d) in FIG. 5.
- the setting interface includes general settings and video settings.
- the general settings include the setting options for resolution, geographic location, and automatic watermarking.
- the video settings it includes the AI smart telescope, reference line, level gauge, shooting mute, and frame insertion mode settings.
- the mobile phone detects that the user clicks on the control 509 (turn on the frame insert mode)
- the mobile phone can automatically enable the frame insert mode when shooting a video.
- the mobile phone can automatically interpolate the collected images to improve the smoothness of the video.
- Figure 6 shows another set of GUIs provided by an embodiment of the present application.
- the GUI is a video display interface.
- the mobile phone detects that the current ambient light brightness is less than the first light brightness threshold, since the actual frame rate is reduced to 15fps, the exposure time of each frame of image will increase by 66.7ms. The increase of the exposure time will cause the object in each frame of image to change The motion trajectory becomes longer, thereby increasing the possibility of blurring within the frame.
- the mobile phone can prompt the user through the display "The current brightness is low, please keep the phone stable!".
- the mobile phone detects that the user has clicked the shooting control 506 it can display the GUI as shown in (b) in FIG. 6.
- the GUI is another video display interface.
- the mobile phone detects that the user has clicked the shooting control 506, the mobile phone starts to record the video. Since the brightness of the environment is less than the first brightness threshold at this time, the mobile phone can automatically turn on the frame insertion mode, collect video data according to the actual frame rate (for example, 15fps), and perform frame interpolation processing on the collected video data. Thereby improving the fluency of the video.
- the mobile phone can also prompt the user through the interface "The current light level is low, and the frame insertion mode has been activated". In this way, the nominal frame rate (for example, 30fps or 24fps) of the video data actually saved by the mobile phone is greater than the actual frame rate.
- the GUI is another video display interface.
- the actual frame rate output by the mobile phone will increase (for example, from 15fps to 30fps).
- the mobile phone may not perform frame insertion processing on the video data collected according to the actual frame rate.
- the mobile phone can prompt the user through the display screen that "the current brightness is high and the frame insertion mode has been exited".
- the mobile phone before the mobile phone is in the video preview interface and has not yet started to record video, if the mobile phone detects that the brightness is less than the first brightness threshold, the mobile phone can start the frame insertion mode when previewing the interface. When the brightness is low, the smoothness of the image that the user sees through the video preview interface will also be better. Or, the mobile phone may not start the frame insertion mode when it is in the video preview interface, but if it detects that the light brightness is less than the first light brightness threshold during the video recording process, the frame insertion mode is automatically started.
- the disclosed system, device, and method can be implemented in other ways.
- the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection between devices or units through some interfaces, and may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
- the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
- the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Studio Devices (AREA)
Abstract
本申请提供了一种图像处理方法和电子设备,该方法应用于电子设备中,该方法包括:该电子设备在检测到当前环境中的环境光亮度小于或者等于第一预设光亮度阈值时,该电子设备出第一帧率;该电子设备根据该第一帧率,采集第一视频数据,该第一视频数据包括多帧图像;该电子设备对该多帧图像进行插帧处理,得到并保存第二视频数据,该第二视频数据的帧率大于该第一帧率。本申请实施例有助于提升视频的流畅度。
Description
本申请要求于2020年3月26日提交中国专利局、申请号为202010225392.7、申请名称为“图像处理方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及终端领域,并且更具体地,涉及一种图像处理方法和电子设备。
在光线充足的情况下,大多数摄影设备都能拍出较好画质的视频,但是在暗光的情况下,受制于环境亮度,设备的感光能力,拍摄出来的图像的流畅度往往是很差的。
发明内容
本申请提供一种图像处理方法和电子设备,有助于提升电子设备在暗光场景下拍摄的图像的流畅度。
第一方面,提供了一种图像处理方法,该方法应用于具有摄像头的电子设备中,该方法包括:该电子设备在检测到当前环境中的环境光亮度小于或者等于第一预设光亮度阈值时,该电子设备的传感器输出第一帧率;该电子设备根据该第一帧率,通过摄像头采集第一视频数据,该第一视频数据包括多帧图像;该电子设备对该多帧图像进行插帧处理,得到并保存第二视频数据,该第二视频数据的帧率大于该第一帧率。
本申请实施例的图像处理方法,在当前电子设备检测到光亮度较低时,可以对采集的视频数据进行插帧处理,从而使得最终得到的视频的帧率大于电子设备传感器出帧的帧率,从而可以提升视频的流畅度。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:该电子设备在检测到当前环境中的环境光亮度大于或者等于第二预设光亮度阈值时,该电子设备的传感器输出第二帧率,该第二帧率大于该第一帧率;该电子设备根据该第二帧率,通过摄像头采集第三视频数据,该第三视频数据的帧率等于该第二帧率;该电子设备保存该第三视频数据。
本申请实施例中,当电子设备检测到光亮度大于第二预设光亮度阈值时,可以提升帧率,从而保证采集的视频数据的流畅度。
结合第一方面,在第一方面的某些实现方式中,该第二预设光亮度阈值大于该第一预设光亮度阈值。
本申请实施例中,通过设置双阈值,可以降低环境光亮度恰好在临界点变化导致的各种突变,例如由于曝光时间的突然下降导致图像亮度以及噪声突变。在光亮度小于或者等于第一光亮度阈值时进行降帧,在光亮度大于或者等于第二光亮度阈值时退出降帧,这样保证了降帧与不降帧之间的震荡。
结合第一方面,在第一方面的某些实现方式中,该多帧图像中包括第a帧图像数据和第a+1帧图像数据,该第a帧图像数据和该第a+1帧图像数据为W×Z的矩阵,a、W和Z为正整数,其中,该电子设备对该多帧图像进行插帧处理,包括:该电子设备根据该第a+1帧图像数据中第M行至第N行中每一行的像素值的和,以及该第a帧图像数据中第k行至第k+N-M行中每一行的像素值的和,确定L个绝对差的总和SAD值,其中,M和N为正整数且1≤M<N≤W,k=1,…,L,L为最大行偏移数;该电子设备根据该第a+1帧图像数据中第P列至第Q列中每一列的像素值的和,以及该第a帧图像数据中第x列至第x+Q-P列中每一列的像素值的和,确定Y个SAD值,其中,P和Q为正整数且1≤P<Q≤Z,x=1,…,Y,Y为最大列偏移数;该电子设备根据该L个SAD值和该Y个SAD值,确定行偏移数和列偏移数;该电子设备根据该行偏移数和该列偏移数,对该第a帧图像数据或者该第a+1帧图像数据进行处理,得到处理后的图像数据;该电子设备将该处理后的图像数据插入该第a帧图像数据和该第a+1帧图像数据。
本申请实施例中,通过计算第a帧图像数据和第a+1帧图像数据中部分行和列的SAD值来确定行偏移量和列偏移量,根据行偏移量和列偏移量对第a帧图像数据或者第a+1帧图像数据进行处理,并将处理后的图像数据插入第a帧图像数据和第a+1帧图像数据之间,从而可以提升处理后图像数据的帧率,提升视频的体长度。
结合第一方面,在第一方面的某些实现方式中,该电子设备根据该L个SAD值和该Y个SAD值,确定行偏移数和列偏移数,包括:该电子设备将该L个SAD值中最小值对应的行偏移数确定为该行偏移数;该电子设备将该Y个SAD值中最小值对应的列偏移数确定为该列偏移数。
结合第一方面,在第一方面的某些实现方式中,该得到处理后的图像数据之前,该方法还包括:该电子设备对该偏移后的数据进行补边处理。
本申请实施例中,在得到处理后的图像数据之前,可以对偏移后的数据进行补边处理,从而提升插帧后图像的画质,避免插帧后图像出现白边。
在一些可能的实现方式中,该电子设备根据该行偏移数和该列偏移数,对该第a帧图像数据或者该第a+1帧图像数据进行处理,得到处理后的图像数据,包括:该电子设备根据该行偏移数和该列偏移数,对该第a+1帧数据进行偏移,得到偏移后的帧数据;该电子设备对该偏移后的数据进行补边处理,得到该处理后的图像数据。
在一些可能的实现方式中,该电子设备根据该行偏移数和该列偏移数,对该第a帧图像数据或者该第a+1帧图像数据进行处理,得到处理后的图像数据,包括:该电子设备根据该行偏移数和该列偏移数,对该第a帧数据进行反向偏移,得到偏移后的帧数据;该电子设备对该偏移后的数据进行补边处理,得到该处理后的图像数据。
第二方面,本技术方案提供了一种图像处理的装置,该装置包含在电子设备中,该装置具有实现上述第一方面及上述第一方面的可能实现方式中第一电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。
第三方面,提供了一种电子设备,包括一个或多个处理器和一个或多个存储器。该一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备 执行上述第一方面任一项可能的实现中的图像处理的方法。
第四方面,本技术方案提供了一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述第一方面及其任一项可能的实现中的推荐服务方法。
第五方面,本技术方案提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面及其任一项可能的实现中的推荐服务方法。
图1是本申请实施例提供的电子设备的结构示意图。
图2是本申请实施例提供的电子设备的软件结构框图。
图3是本申请实施例提供的一种图像处理方法的示意性流程图。
图4是本申请实施例提供的一种插帧算法流程。
图5是本申请实施例提供的一组GUI。
图6是本申请实施例提供的另一组GUI。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“复数个”或者“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
本申请实施例提供的方法可以应用于手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备上,本申请实施例对电子设备的具体类型不作任何限制。
示例性的,图1示出了电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本 申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过 UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通 信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程 序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。
气压传感器180C用于测量气压。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。
环境光传感器180L用于感知环境光亮度。
电指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。骨传导传感器180M可以获取振动信号。电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。
本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图2是本申请实施例的电子设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏, 锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
对于人眼而言,只有在24fps以上的视频,才能得到流畅的视觉感受。因此设备只有保持在24fps以上流畅度才能使人接受。目前主流的视频输出帧率为30fps,此时视频源的最大曝光时长为33ms。如果低于24fps,例如输出15fps的视频,可以将最大曝光提升至66.67ms,相对30fps直接提升了一倍的曝光时间。同等感光条件下,曝光时间长一倍。那么视频的亮度、清晰度、噪声、颜色均会有较大提升。但是15fps会有非常明显的卡顿,使得正常用户无法接受。
为了充分利用降低帧率带来的曝光时间增长,本申请实施例提出了一种图像处理方法,可以提升视频输出的帧率,增强视频的流畅性,使得视频流畅性达到用户可接受程度。
图3示出了本申请实施例提供了一种图像处理方法300的示意性流程图,如图3所示,该方法300包括:
S301,电子设备检测当前环境中的光亮度。
S302,电子设备在检测到环境光亮度小于或者等于第一光亮度阈值时,电子设备输出的实际帧率为第一帧率。
应理解,本申请中的实际帧率是指电子设备的传感器(sensor)出帧的帧率。
示例性的,第一光亮度阈值为1lux。当电子设备检测到当前环境中光亮度小于或者等于1lux时,电子设备可以输出实际帧率为15fps。那么电子设备每一帧的图像的曝光时长为66.7ms。
S303,电子设备按照所述第一帧率,通过摄像头采集第一视频数据,所述第一视频数据中包括多帧图像。
S304,电子设备对该多帧图像进行插帧处理,得到第二视频数据,所述第二视频数据的帧率大于所述第一帧率。
本申请实施例中,第二视频的帧率也可以称之为标称帧率,在电子设备确定当前环境光亮度小于1lux时,电子设备输出的实际帧率可以为15fps,曝光时长为66.7ms,第二视频数据的标称帧率可以为30fps或者24fps。
S305,电子设备判断当前环境中的光亮度和第二光亮度阈值的关系。
S306,电子设备确定当前环境中的光亮度大于或者等于第二光亮度阈值时,电子设备输出实际帧率为第二帧率。
示例性的,第二光亮度阈值为2lux。当电子设备检测到当前环境中光亮度大于或者等于2lux时,电子设备可以输出实际帧率为30fps。那么电子设备每一帧的图像的曝光时长为33.3ms。
本申请实施例中,通过设置双阈值,可以降低环境光亮度恰好在临界点变化导致的各种突变,例如由于曝光时间的突然下降导致图像亮度以及噪声突变。在光亮度小于或者等于第一光亮度阈值时进行降帧,在光亮度大于或者等于第二光亮度阈值时退出降帧,这样保证了降帧与不降帧之间的震荡。
若S305中电子设备判断当前环境中的光亮度小于该第二光亮度阈值,那么电子设备继续执行上述S303-S304的步骤。
S307,电子设备按照所述第二帧率,通过摄像头采集第三视频数据,该第三视频数据的标称帧率等于第二帧率。
本申请实施例中,在极暗场景下(例如,光亮度小于1lux),电子设备在按照实际帧率通过摄像头采集视频数据,可以视频数据进行插帧处理,从而可以提升视频的帧率,这样可以提升用户观看视频时的流畅度。
图4示出了本申请实施例提供的一种插帧算法流程。下面以在第a帧和第a+1帧之间进行插帧为例进行说明,其中,a为大于或者等于1的正整数。
本申请实施例中,为了便于理解,以第a帧和第a+1帧的数据为10×10的像素值矩阵为例进行说明。本领域技术人员可知,如果当前屏幕的分辨率为1920×1080,那么摄像头采集获得的第a帧数据或者第a+1帧数据为1920×1080的像素值矩阵。
示例性的,第a帧数据为
其中矩阵中每一个元素表示一个像素值。本申请实施例中为了方便描述,以像素值为0~9为例说明,实际情况下像素值的取值范围可以是0~255。
示例性的,第a+1帧数据为
步骤401a,确定第a+1帧数据中心区域第M行至第N行中每一行的像素值的和。
由于第a+1帧数据的中心区域为第四行或者第五行,那么可以选择第四行或者第五行为第a+1帧数据的中心区域。下面以选择第四行为中心区域为例进行说明。
选择中心区域第M行至第N行时,可以从中心区域开始向上选择若干行,并向下选择若干行。例如,可以从中心区域向上选择2行且向下选择2行,即选择第2行至第6行。其中,第2行的像素值的和为32,第3行的像素值的和为31,第4行的像素值的和为34,第5行的像素值的和为35,第6行的像素值的和为35。
步骤402a,确定第a帧数据中第k行至第k+N-M行中每一行的像素值之和,其中,k为大于或者等于1的正整数,k≤L,L为限定的最大行偏移数。
示例性的,由于在第a+1帧数据中选择的是第2行至第6行的数据,那么在第a帧数据中选择行时,可以选择向上偏移0行,即选择第a帧数据中第2行至第6行的数据;也可以选择向上偏移1行,即选择第a帧数据中第1行至第5行的数据,1也是向上偏移的最大搜索偏移数。
例如,当向上偏移0行时,可以选择的第a帧数据中第2行的像素值的和为36,第3行的像素值的和为38,第4行的像素值的和为40,第5行的像素值的和为37,第6行的像素值之和为41。
又例如,当向上偏移1行时,可以选择的第a帧数据中第1行的像素值的和为29,第2行的像素值的和为36,第3行的像素值的和为38,第4行的像素值的和为40,第5行的像素值的和为37。
示例性的,在第a帧数据中选择行时,可以选择向下偏移1行或者2行,其中,2为 向下偏移的最大搜索偏移数。
例如,向下偏移1行时,可以选择的第a帧数据中第3行的像素值的和为38,第4行的像素值的和为40,第5行的像素值的和为37,第6行的像素值之和为41,第7行的像素值的和为30。
例如,向下偏移2行时,可以选择的第a帧数据中第4行的像素值的和为40,第5行的像素值的和为37,第6行的像素值之和为41,第7行的像素值的和为30,第8行的像素值的和为40。
步骤403a,将步骤402a中获得第k行至第k+N-M行矩阵中的每一行像素值之和与步骤401a中获得的每一行像素值之和依次做差,得到绝对差的总和(SAD),确定最小的SAD值对应的行偏移量。
示例性的,当步骤402a中向上偏移0行时,第a帧数据中第2行的像素值的和与第a+1帧数据中第2行的像素值的和的绝对差为4;第a帧数据中第3行的像素值的和与第a+1帧数据中第3行的像素值的和的绝对差为7;第a帧数据中第4行的像素值的和与第a+1帧数据中第4行的像素值的和的绝对差为6;第a帧数据中第5行的像素值的和与第a+1帧数据中第5行的像素值的和的绝对差为2;第a帧数据中第6行的像素值的和与第a+1帧数据中第6行的像素值的和的绝对差为6。那么,在向上偏移0行时,SAD值为25。
示例性,当步骤402a中向上偏移1行时,第a帧数据中第1行的像素值的和与第a+1帧数据中第2行的像素值的和的绝对差为3;第a帧数据中第2行的像素值的和与第a+1帧数据中第3行的像素值的和的绝对差为5;第a帧数据中第3行的像素值的和与第a+1帧数据中第4行的像素值的和的绝对差为4;第a帧数据中第4行的像素值的和与第a+1帧数据中第5行的像素值的和的绝对差为5;第a帧数据中第5行的像素值的和与第a+1帧数据中第6行的像素值的和的绝对差为2。那么,在向上偏移1行时,SAD值为19。
示例性的,当步骤402a中向下偏移1行时,第a帧数据中第3行的像素值的和与第a+1帧数据中第2行的像素值的和的绝对差为6;第a帧数据中第4行的像素值的和与第a+1帧数据中第3行的像素值的和的绝对差为9;第a帧数据中第5行的像素值的和与第a+1帧数据中第4行的像素值的和的绝对差为3;第a帧数据中第6行的像素值的和与第a+1帧数据中第5行的像素值的和的绝对差为6;第a帧数据中第7行的像素值的和与第a+1帧数据中第6行的像素值的和的绝对差为5。那么,在向下偏移1行时,SAD值为29。
示例性的,当步骤402a中向下偏移2行时,第a帧数据中第4行的像素值的和与第a+1帧数据中第2行的像素值的和的绝对差为8;第a帧数据中第5行的像素值的和与第a+1帧数据中第3行的像素值的和的绝对差为6;第a帧数据中第6行的像素值的和与第a+1帧数据中第4行的像素值的和的绝对差为7;第a帧数据中第7行的像素值的和与第a+1帧数据中第5行的像素值的和的绝对差为5;第a帧数据中第8行的像素值的和与第a+1帧数据中第6行的像素值的和的绝对差为5。那么,在向下偏移2行时,SAD值为31。
根据以上SAD值,可以确定在向上偏移1行时SAD值最小。
同样的,可以通过步骤401b~403b确定列偏移量。
步骤401b,确定第a+1帧数据中心区域第P列至第Q列中每一列的像素值的和。
由于第a+1帧数据的中心区域为第四列或者第五列,那么可以选择第四列或者第五列为第a+1帧数据的中心区域。下面以选择第四列为中心区域为例进行说明。
选择中心区域第P列至第Q列时,可以从中心区域开始向左选择若干列,并向右选择若干列。例如,可以从中心区域向左选择2列且向右选择2列,即选择第2列至第6列。其中,第2列的像素值的和为31,第3列的像素值的和为36,第4列的像素值的和为30,第5列的像素值的和为29,第6列的像素值的和为37。
应理解,步骤401b中选择的列的个数可以和步骤401a中选择的行的个数相同或者不同。例如,在步骤401b中,也可以选择从中心区域(第四列)向左选择1列,并向右选择1列,即选择第3列至第5列的数据。
步骤402b,确定第a帧数据中第x列至第x+Q-P列中每一列的像素值之和,其中,x为大于或者等于1的正整数,x≤Y,Y为限定的最大列偏移数。
示例性的,由于在第a+1帧数据中选择的是第2列至第6列的数据,那么在第a帧数据中选择列时,可以选择向左偏移0列,即选择第a帧数据中第2列至第6列的数据;也可以选择向左偏移1列,即选择第a帧数据中第1列至第5列的数据,1也是向左偏移的最大列偏移数。
例如,当向左偏移0列时,可以选择的第a帧数据中第2列的像素值的和为51,第3列的像素值的和为28,第4列的像素值的和为48,第5列的像素值的和为31,第6列的像素值之和为36。
又例如,当向左偏移1列时,可以选择的第a帧数据中第1列的像素值的和为36,第2列的像素值的和为51,第3列的像素值的和为28,第4列的像素值的和为48,第5列的像素值的和为31。
示例性的,在第a帧数据中选择列时,可以选择向右偏移1列或者2列,其中,2为向右偏移的最大列偏移数。
例如,向右偏移1列时,可以选择的第a帧数据中第3列的像素值的和为28,第4列的像素值的和为48,第5列的像素值的和为31,第6列的像素值之和为36,第7列的像素值的和为32。
例如,向右偏移2列时,可以选择的第a帧数据中第4列的像素值的和为48,第5列的像素值的和为31,第6列的像素值之和为36,第7列的像素值的和为32,第8列的像素值的和为27。
步骤403b,将步骤402b中获得x列至第x+Q-P列矩阵中的每一列像素值之和与步骤401b中获得的每一列像素值之和依次做差,得到绝对差的总和(SAD),确定最小的SAD值对应的列偏移数。
示例性的,当步骤402b中向左偏移0列时,第a帧数据中第2列的像素值的和与第a+1帧数据中第2列的像素值的和的绝对差为20;第a帧数据中第3列的像素值的和与第a+1帧数据中第3列的像素值的和的绝对差为8;第a帧数据中第4列的像素值的和与第a+1帧数据中第4列的像素值的和的绝对差为18;第a帧数据中第5列的像素值的和与第a+1帧数据中第5列的像素值的和的绝对差为2;第a帧数据中第6列的像素值的和与第a+1帧数据中第6列的像素值的和的绝对差为1。那么,在向左偏移0列时,SAD值为49。
示例性,当步骤402b中向左偏移1列时,第a帧数据中第1列的像素值的和与第a+1帧数据中第2列的像素值的和的绝对差为5;第a帧数据中第2列的像素值的和与第a+1帧数据中第3列的像素值的和的绝对差为15;第a帧数据中第3列的像素值的和与第a+1 帧数据中第4列的像素值的和的绝对差为2;第a帧数据中第4列的像素值的和与第a+1帧数据中第5列的像素值的和的绝对差为19;第a帧数据中第5列的像素值的和与第a+1帧数据中第6列的像素值的和的绝对差为6。那么,在向左偏移1列时,SAD值为47。
示例性的,当步骤402b中向右偏移1列时,第a帧数据中第3列的像素值的和与第a+1帧数据中第2列的像素值的和的绝对差为3;第a帧数据中第4列的像素值的和与第a+1帧数据中第3列的像素值的和的绝对差为12;第a帧数据中第5列的像素值的和与第a+1帧数据中第4列的像素值的和的绝对差为1;第a帧数据中第6列的像素值的和与第a+1帧数据中第5列的像素值的和的绝对差为7;第a帧数据中第7列的像素值的和与第a+1帧数据中第6列的像素值的和的绝对差为5。那么,在向右偏移1列时,SAD值为28。
示例性的,当步骤402b中向右偏移2列时,第a帧数据中第4列的像素值的和与第a+1帧数据中第2列的像素值的和的绝对差为17;第a帧数据中第5列的像素值的和与第a+1帧数据中第3列的像素值的和的绝对差为5;第a帧数据中第6列的像素值的和与第a+1帧数据中第4列的像素值的和的绝对差为6;第a帧数据中第7列的像素值的和与第a+1帧数据中第5列的像素值的和的绝对差为3;第a帧数据中第8列的像素值的和与第a+1帧数据中第6列的像素值的和的绝对差为10。那么,在向下偏移2列时,SAD值为41。
根据以上SAD值,可以确定在向右偏移1列时SAD值最小。
应理解,本申请实施例中确定行偏移量和列偏移量时可以选择SAD最小值对应的偏移量,也可以选择其他SAD值对应的偏移量来确定行偏移量和列偏移量。
步骤404,根据步骤403a中的行偏移量以及步骤403b中的列偏移量,对第a+1帧数据或者第a帧数据进行整体偏移。
示例性的,由以上描述可以获知,对第a+1帧图像进行向上偏移1行且向右偏移1列的操作,可以获得偏移后的帧数据为
或者,也可以对第a帧图像进行相反的偏移操作,例如对第a帧图像向下偏移1行且向左偏移1列后,可以获得偏移后的帧数据为
步骤405,对偏移后的帧数据进行补边操作。
由于在偏移后,会有部分边缘像素值为空,需要进行补边操作,可以使用镜像或者拉伸去处理边缘异常。
示例性的,可以采用镜像的方式进行补边操作。可以将偏移后的帧数据中第7行的数据镜像到第8行,并将第2列的数据镜像到第1列,从而得到补边处理后的帧数据
本申请实施例中,还可以对偏移后的帧数据进行拉伸去处理边缘异常。例如,如果偏移后的帧数据为
那么可以先对行进行拉伸处理后可以得到补边处理后的帧数据
然后在对列进行拉伸处理后得到最终补边处理后的帧数据
应理解,本申请实施例中,步骤405的操作是可选地。
一个实施例中,在步骤401a中还可以选择第a帧数据的中心区域第M行至第N行中每一行的像素值的和;在步骤402a中确定第a+1帧中第k行至第k+N-M行中每一行的像素值的和;在步骤403a中获得第a+1帧数据中第k行至第k+N-M行矩阵中的每一行像素值的和与第a帧数据中第N行至第M行中的每一行像素值的和依次做差,确定最小SAD值对应的行偏移量。并按照上述步骤得到最小SAD值对应的列偏移量。最后根据行偏移量和列偏移量对第a帧数据进行整体偏移,得到偏移后的帧数据;或者,根据行偏移量和列偏移量的相反方向,对第a+1帧数据进行整体偏移,得到偏移后的帧数据。
步骤406,将补边处理后的帧数据插入第a帧数据和第a+1帧数据之间,从而提升视频流畅度。
图5示出了本申请实施例提供的一组用户图形界面(graphical user interface,GUI)。
参见图5中的(a),该GUI为手机的桌面501。当手机检测到用户点击桌面501上的相机应用(application,APP)的图标502的操作后,可以启动相机应用,显示如图5中的(b)所示的GUI,该GUI可以称为拍摄界面503。该拍摄界面503上可以包括取景框504。在预览状态下,该取景框504内可以实时显示预览图像,当手机检测到用户点击拍摄控件506后,手机执行拍照操作,并将拍摄的照片保存下来,当手机检测到用户点击相册的图标507后,可以在触摸屏上展示已经拍摄的照片或者视频等。
可以理解的是,在手机检测到用户点击图标502的操作后,手机打开相机应用后默认在拍照模式下,该GUI界面上还包括录像模式、专业模式和更多等等模式,当手机检测到用户点击录像模式的图标405后,显示如图5中的(c)所示的GUI。
参见图5中的(c),该GUI为录像显示界面。当手机检测到用户点击控件508的操作后,手机可以显示如图5中的(d)所示的GUI。
参见图5中的(d),该GUI为设置界面。设置界面上包括通用设置以及视频设置。其中,通用设置中包括分辨率、地理位置以及自动添加水印的设置选项。在视频设置中,包括了AI智能远镜、参考线、水平仪、拍摄静音以及插帧模式的设置。当手机检测到用户点击控件509(开启插帧模式)的操作时,手机可以在拍摄视频时自动启用插帧模式。在暗场场景下,手机可以自动对采集的图像进行插帧处理,从而提升视频流畅度。
图6示出了本申请实施例提供的另一组GUI。
参见图6中的(a)所示,该GUI为录像显示界面。当手机检测到当前环境光亮度小于第一光亮度阈值后,由于实际帧率降低到15fps,那么每一帧图像的曝光时长增加值66.7ms,曝光时长的增加会导致每一帧图像中物体的运动轨迹变长,从而增加了帧内模糊的可能。手机可以通过显示屏提示用户“当前亮度低,请保持手机稳定!”。当手机检测到用户点击拍摄控件506的操作后,可以显示如图6中的(b)所示的GUI。
参见图6中的(b)所示,该GUI为另一录像显示界面。当手机检测到用户点击拍摄控件506的操作后,手机开始录制视频。由于此时环境中的光亮度小于第一光亮度阈值,那么手机可以自动开启插帧模式,根据实际帧率(例如,15fps)采集的视频数据,并对采集到的视频数据进行插帧处理,从而提升视频的流畅度。如图6中的(b)所示,手机还可以通过界面提示用户“当前光亮度低,已启动插帧模式”。这样手机实际保存的视频数据的标称帧率(例如,30fps或者24fps)是大于实际帧率的。
参见图6中的(c)所示,该GUI为另一录像显示界面。手机在拍摄视频的过程中,如果手机检测到当前环境光亮度大于或者等于第二光亮度阈值,那么手机输出的实际帧率会提升(例如,从15fps提升至30fps)。此时由于实际帧率已经可以满足视频流畅度的需求,那么手机可以不对根据实际帧率采集的视频数据进行插帧处理。如图6中的(c)所示,手机可以通过显示屏提示用户“当前光亮度较高,已退出插帧模式”。
应理解,本申请实施例中,在手机处于录像预览界面且还没有开始录制视频之前,如果手机检测到光亮度小于第一光亮度阈值,那么手机可以在预览界面时就启动插帧模式,这样在光亮度较低时,用户通过录像预览界面看到的图像的流畅度也会较好。或者,手机在处于录像预览界面时可以不启动插帧模式,而是在视频录制过程中如果检测到光亮度小于第一光亮度阈值,自动启动插帧模式。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的 间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
Claims (14)
- 一种图像处理方法,其特征在于,所述方法应用于电子设备中,所述方法包括:所述电子设备在检测到当前环境中的环境光亮度小于或者等于第一预设光亮度阈值时,所述电子设备输出第一帧率;所述电子设备根据所述第一帧率,采集第一视频数据,所述第一视频数据包括多帧图像;所述电子设备对所述多帧图像进行插帧处理,得到并保存第二视频数据,所述第二视频数据的帧率大于所述第一帧率。
- 根据权利要求1所述的方法,其特征在于,所述多帧图像中包括第a帧图像数据和第a+1帧图像数据,所述第a帧图像数据和所述第a+1帧图像数据为W×Z的矩阵,a、W和Z为正整数,其中,所述电子设备对所述多帧图像进行插帧处理,包括:所述电子设备根据所述第a+1帧图像数据中第M行至第N行中每一行的像素值的和,以及所述第a帧图像数据中第k行至第k+N-M行中每一行的像素值的和,确定L个绝对差的总和SAD值,其中,M和N为正整数且1≤M<N≤W,k=1,…,L,L为最大行偏移数;所述电子设备根据所述第a+1帧图像数据中第P列至第Q列中每一列像素值的和,以及所述第a帧图像数据中第x列至第x+Q-P列中每一列的像素值的和,确定Y个SAD值,其中,P和Q为正整数且1≤P<Q≤Z,x=1,…,Y,Y为最大列偏移数;所述电子设备根据所述L个SAD值和所述Y个SAD值,确定行偏移数和列偏移数;所述电子设备根据所述行偏移数和所述列偏移数,对所述第a帧图像数据或者所述第a+1帧图像数据进行处理,得到处理后的图像数据;所述电子设备将所述处理后的图像数据插入所述第a帧图像数据和所述第a+1帧图像数据。
- 根据权利要求2所述的方法,其特征在于,所述电子设备根据所述L个SAD值和所述Y个SAD值,确定行偏移数和列偏移数,包括:所述电子设备将所述L个SAD值中最小值对应的行偏移数确定为所述行偏移数;所述电子设备将所述Y个SAD值中最小值对应的列偏移数确定为所述列偏移数。
- 根据权利要求2或3所述的方法,其特征在于,所述得到处理后的图像数据之前,所述方法还包括:所述电子设备对偏移后的数据进行补边处理。
- 根据权利要求1至4中任一项所述的方法,其特征在于,所述方法还包括:所述电子设备在检测到当前环境中的环境光亮度大于或者等于第二预设光亮度阈值时,所述电子设备输出第二帧率,所述第二帧率大于所述第一帧率;所述电子设备根据所述第二帧率,通过摄像头采集第三视频数据,所述第三视频数据的帧率等于所述第二帧率;所述电子设备保存所述第三视频数据。
- 根据权利要求5所述的方法,其特征在于,所述第二预设光亮度阈值大于所述第一 预设光亮度阈值。
- 一种电子设备,其特征在于,包括:摄像头;传感器;一个或多个处理器;一个或多个存储器;所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:在检测到当前环境中的环境光亮度小于或者等于第一预设光亮度阈值时,通过所述传感器输出第一帧率;根据所述第一帧率,通过所述摄像头采集第一视频数据,所述第一视频数据包括多帧图像;对所述多帧图像进行插帧处理,得到并保存第二视频数据,所述第二视频数据的帧率大于所述第一帧率。
- 根据权利要求7所述的电子设备,其特征在于,所述多帧图像中包括第a帧图像数据和第a+1帧图像数据,所述第a帧图像数据和所述第a+1帧图像数据为W×Z的矩阵,a、W和Z为正整数,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:根据所述第a+1帧图像数据中第M行至第N行中每一行的像素值的和,以及所述第a帧图像数据中第k行至第k+N-M行中每一行的像素值的和,确定L个绝对差的总和SAD值,其中,M和N为正整数且1≤M<N≤W,k=1,…,L,L为最大行偏移数;根据所述第a+1帧图像数据中第P列至第Q列中每一列像素值的和,以及所述第a帧图像数据中第x列至第x+Q-P列中每一列的像素值的和,确定Y个SAD值,其中,P和Q为正整数且1≤P<Q≤Z,x=1,…,Y,Y为最大列偏移数;根据所述L个SAD值和所述Y个SAD值,确定行偏移数和列偏移数;根据所述行偏移数和所述列偏移数,对所述第a帧图像数据或者所述第a+1帧图像数据进行处理,得到处理后的图像数据;将所述处理后的图像数据插入所述第a帧图像数据和所述第a+1帧图像数据。
- 根据权利要求8所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:将所述L个SAD值中最小值对应的行偏移数确定为所述行偏移数;将所述Y个SAD值中最小值对应的列偏移数确定为所述列偏移数。
- 根据权利要求8或9所述的电子设备,其特征在于,所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:所述得到处理后的图像数据之前,对偏移后的数据进行补边处理。
- 根据权利要求7至10中任一项所述的电子设备,其特征在于,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:在检测到当前环境中的环境光亮度大于或者等于第二预设光亮度阈值时,通过所述传感器输出第二帧率,所述第二帧率大于所述第一帧率;根据所述第二帧率,通过摄像头采集第三视频数据,所述第三视频数据的帧率等于所述第二帧率;保存所述第三视频数据。
- 根据权利要求11所述的电子设备,其特征在于,所述第二预设光亮度阈值大于所述第一预设光亮度阈值。
- 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-6中任一项所述的图像处理的方法。
- 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-6中任一项所述的图像处理的方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US17/914,141 US20230043815A1 (en) | 2020-03-26 | 2021-03-16 | Image Processing Method and Electronic Device |
EP21774675.9A EP4109882A4 (en) | 2020-03-26 | 2021-03-16 | IMAGE PROCESSING METHOD AND ELECTRONIC DEVICE |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010225392.7 | 2020-03-26 | ||
CN202010225392.7A CN113452921A (zh) | 2020-03-26 | 2020-03-26 | 图像处理方法和电子设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021190348A1 true WO2021190348A1 (zh) | 2021-09-30 |
Family
ID=74304555
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/080990 WO2021190348A1 (zh) | 2020-03-26 | 2021-03-16 | 图像处理方法和电子设备 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20230043815A1 (zh) |
EP (1) | EP4109882A4 (zh) |
CN (2) | CN112333397B (zh) |
WO (1) | WO2021190348A1 (zh) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112333397B (zh) * | 2020-03-26 | 2022-05-13 | 华为技术有限公司 | 图像处理方法和电子设备 |
CN115150523A (zh) * | 2021-03-31 | 2022-10-04 | 华为技术有限公司 | 一种同步拍摄方法、第一电子设备和第二电子设备 |
CN113919382B (zh) * | 2021-04-29 | 2023-04-28 | 荣耀终端有限公司 | 一种扫码的方法及装置 |
JP2023019712A (ja) * | 2021-07-29 | 2023-02-09 | トヨタ自動車株式会社 | 画像生成装置、画像生成方法、及び車両制御システム |
CN116739014B (zh) * | 2022-09-15 | 2024-09-17 | 荣耀终端有限公司 | 一种扫码方法及电子设备 |
CN116708931B (zh) * | 2022-11-14 | 2024-03-15 | 荣耀终端有限公司 | 图像处理方法及电子设备 |
CN118450253A (zh) * | 2023-09-26 | 2024-08-06 | 荣耀终端有限公司 | 图像对焦方法及相关设备 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1728832A (zh) * | 2004-07-27 | 2006-02-01 | 富士通株式会社 | 具有基于垂直分量的运动向量校正的运动估计和补偿设备 |
US20090022411A1 (en) * | 2007-07-20 | 2009-01-22 | Sanyo Electric Co., Ltd. | Image display apparatus |
CN106412451A (zh) * | 2015-07-28 | 2017-02-15 | 联发科技股份有限公司 | 图像处理方法、装置以及系统 |
CN109640168A (zh) * | 2018-11-27 | 2019-04-16 | Oppo广东移动通信有限公司 | 视频处理方法、装置、电子设备和计算机可读介质 |
CN112333397A (zh) * | 2020-03-26 | 2021-02-05 | 华为技术有限公司 | 图像处理方法和电子设备 |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0986262A3 (en) * | 1998-08-31 | 2004-04-07 | Texas Instruments Incorporated | Unrestricted motion compensation |
JP4556995B2 (ja) * | 2007-12-10 | 2010-10-06 | カシオ計算機株式会社 | 撮像装置及びその露出制御方法、露出制御プログラム |
JP2013165487A (ja) * | 2012-01-11 | 2013-08-22 | Panasonic Corp | 画像処理装置、撮像装置、およびプログラム |
CN104580969A (zh) * | 2013-10-23 | 2015-04-29 | 中兴通讯股份有限公司 | 录像帧率调整方法和装置 |
KR20150069413A (ko) * | 2013-12-13 | 2015-06-23 | 삼성디스플레이 주식회사 | 표시 장치 및 그 구동 방법 |
US20150373293A1 (en) * | 2014-06-24 | 2015-12-24 | Sony Corporation | Video acquisition with adaptive frame rate |
EP3682636B1 (en) * | 2017-10-09 | 2023-08-02 | Huawei Technologies Co., Ltd. | Memory access window and padding for motion vector refinement |
CN117354506A (zh) * | 2018-06-29 | 2024-01-05 | 英迪股份有限公司 | 对图像解码和编码的方法及非暂态计算机可读存储介质 |
CN109922372B (zh) * | 2019-02-26 | 2021-10-12 | 深圳市商汤科技有限公司 | 视频数据处理方法及装置、电子设备和存储介质 |
-
2020
- 2020-03-26 CN CN202011036147.8A patent/CN112333397B/zh active Active
- 2020-03-26 CN CN202010225392.7A patent/CN113452921A/zh active Pending
-
2021
- 2021-03-16 US US17/914,141 patent/US20230043815A1/en active Pending
- 2021-03-16 WO PCT/CN2021/080990 patent/WO2021190348A1/zh unknown
- 2021-03-16 EP EP21774675.9A patent/EP4109882A4/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1728832A (zh) * | 2004-07-27 | 2006-02-01 | 富士通株式会社 | 具有基于垂直分量的运动向量校正的运动估计和补偿设备 |
US20090022411A1 (en) * | 2007-07-20 | 2009-01-22 | Sanyo Electric Co., Ltd. | Image display apparatus |
CN106412451A (zh) * | 2015-07-28 | 2017-02-15 | 联发科技股份有限公司 | 图像处理方法、装置以及系统 |
CN109640168A (zh) * | 2018-11-27 | 2019-04-16 | Oppo广东移动通信有限公司 | 视频处理方法、装置、电子设备和计算机可读介质 |
CN112333397A (zh) * | 2020-03-26 | 2021-02-05 | 华为技术有限公司 | 图像处理方法和电子设备 |
Non-Patent Citations (1)
Title |
---|
See also references of EP4109882A4 |
Also Published As
Publication number | Publication date |
---|---|
CN113452921A (zh) | 2021-09-28 |
EP4109882A4 (en) | 2023-06-07 |
EP4109882A1 (en) | 2022-12-28 |
CN112333397A (zh) | 2021-02-05 |
US20230043815A1 (en) | 2023-02-09 |
CN112333397B (zh) | 2022-05-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021190348A1 (zh) | 图像处理方法和电子设备 | |
WO2021147482A1 (zh) | 一种长焦拍摄的方法及电子设备 | |
CN115473957B (zh) | 一种图像处理方法和电子设备 | |
WO2021249053A1 (zh) | 图像处理的方法及相关装置 | |
WO2021244295A1 (zh) | 拍摄视频的方法和装置 | |
CN113099146B (zh) | 一种视频生成方法、装置及相关设备 | |
CN112532892B (zh) | 图像处理方法及电子装置 | |
WO2022017205A1 (zh) | 一种显示多个窗口的方法及电子设备 | |
WO2022007862A1 (zh) | 图像处理方法、系统、电子设备及计算机可读存储介质 | |
WO2021013132A1 (zh) | 输入方法及电子设备 | |
CN113705665B (zh) | 图像变换网络模型的训练方法和电子设备 | |
EP4436198A1 (en) | Method for capturing images in video, and electronic device | |
WO2022156473A1 (zh) | 一种播放视频的方法及电子设备 | |
CN113986162A (zh) | 图层合成方法、设备及计算机可读存储介质 | |
WO2023093169A1 (zh) | 拍摄的方法和电子设备 | |
WO2023035921A1 (zh) | 一种录像中抓拍图像的方法及电子设备 | |
WO2024179101A9 (zh) | 一种拍摄方法 | |
WO2024179101A1 (zh) | 一种拍摄方法 | |
CN116916151B (zh) | 拍摄方法、电子设备和存储介质 | |
EP4262226A1 (en) | Photographing method and related device | |
WO2023160224A9 (zh) | 一种拍摄方法及相关设备 | |
CN113891008B (zh) | 一种曝光强度调节方法及相关设备 | |
CN115460343A (zh) | 图像处理方法、设备及存储介质 | |
CN114172596A (zh) | 信道噪声检测方法及相关装置 | |
CN115691370A (zh) | 显示控制方法及相关装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21774675 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2021774675 Country of ref document: EP Effective date: 20220921 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |