WO2022218216A1 - 图像处理方法和终端设备 - Google Patents

图像处理方法和终端设备 Download PDF

Info

Publication number
WO2022218216A1
WO2022218216A1 PCT/CN2022/085763 CN2022085763W WO2022218216A1 WO 2022218216 A1 WO2022218216 A1 WO 2022218216A1 CN 2022085763 W CN2022085763 W CN 2022085763W WO 2022218216 A1 WO2022218216 A1 WO 2022218216A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame
terminal device
camera
registration information
area
Prior art date
Application number
PCT/CN2022/085763
Other languages
English (en)
French (fr)
Inventor
吴虹
许亦然
杨炜暾
陈文东
刘蒙
张华�
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP22787442.7A priority Critical patent/EP4300941A1/en
Publication of WO2022218216A1 publication Critical patent/WO2022218216A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/45Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from two or more image sensors being of different type or operating in different modes, e.g. with a CMOS sensor for moving images in combination with a charge-coupled device [CCD] for still images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/681Motion detection
    • H04N23/6811Motion detection based on the image signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/682Vibration or motion blur correction
    • H04N23/685Vibration or motion blur correction performed by mechanical compensation
    • H04N23/687Vibration or motion blur correction performed by mechanical compensation by shifting the lens or sensor position
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • the present application relates to the technical field of terminals and image processing, and in particular, to an image processing method and a terminal device.
  • the camera of the smart terminal can be equipped with a physical device of optical image stabilization (OIS).
  • OIS optical image stabilization
  • OIS can effectively alleviate the problem of inconsistency in definition between frames, but it cannot completely solve the problem.
  • OIS optical image stabilization
  • the present application provides an image processing method, which is used to improve the consistency of sharpness of images captured by a terminal device.
  • the present application provides an image processing method, comprising: in response to a user's first operation, a terminal device activates a first camera; when detecting that the first camera is activated, the terminal device activates a second camera, wherein The second camera is equipped with OIS optical image stabilization; the terminal device obtains the first frame collected by the first camera; the terminal device obtains the second frame collected by the second camera, and the second frame corresponds to the first frame; the The terminal device fuses the second frame into the first frame to obtain a deblurred frame; the terminal device displays an image of the deblurred frame.
  • the terminal device when the terminal device starts shooting with the first camera, it can simultaneously start the second camera with OIS, and use the second frame collected by the second camera with OIS to delete the first frame collected by the first camera.
  • the blurring process can make the terminal device have a better deblurring effect on the blurred frame, so that the definition consistency of the picture displayed by the terminal device is higher.
  • the method before the terminal device acquires the second frame collected by the second camera, the method further includes: the terminal device determines that the first frame is a blurred frame; the terminal device Before fusing the second frame into the first frame to obtain a deblurred frame, the method further includes: determining, by the terminal device, the second frame as a clear frame.
  • the clear frame is used to perform deblurring processing on the blurred frame, and yes, the deblurring effect of the terminal device is better.
  • the terminal device before the terminal device starts the second camera, it further includes: the terminal device determines whether the first camera is equipped with OIS; if the first camera is not equipped with OIS, starting the second camera Second camera.
  • the terminal device can determine in real time whether the activated camera is equipped with OIS, and only when the activated camera is not equipped with OIS, will the second camera equipped with OIS be activated, instead of launching another camera equipped with OIS as long as the activated camera is activated.
  • the OIS camera reduces the power consumption of the terminal device.
  • the terminal device fuses the second frame into the first frame to obtain a deblurred frame, which specifically includes: the terminal device determines to convert the second frame to the first frame. The registration information of the first frame; the terminal device fuses the second frame into the first frame according to the registration information to obtain the deblurred frame.
  • the terminal device fuses the second frame into the first frame according to the registration information, so that the fusion is more accurate, and the deblurring effect of the obtained deblurred frame is better.
  • the terminal device determines the registration information for converting the second frame to the first frame, specifically including: the terminal device according to the first frame and the first frame The feature points extracted after the two-frame downsampling generate global low-precision registration information; the terminal device generates local high-precision registration information according to the feature points extracted after cropping the first frame and the second frame; the terminal The device uses the local high-precision registration information to calibrate the global low-precision registration information to obtain global high-precision registration information as registration information for converting the second frame to the first frame.
  • the terminal device when performing deblurring processing, downsamples the first frame and the second frame respectively, extracts feature points for matching to obtain global low-precision registration information, and cuts and extracts feature points and matches to obtain local low-precision registration information. High-precision registration information, and then use the local high-precision registration information to calibrate the global low-precision registration information to obtain the global high-precision information required for deblurring, which greatly reduces the calculation required for image registration. Therefore, even if the terminal device is a mobile terminal device, it is possible to implement real-time deblurring processing, so that the image captured by the mobile terminal device has higher consistency in definition.
  • the terminal device generates global low-precision registration information according to the feature points extracted after downsampling the first frame and the second frame, specifically including: the terminal The device downsamples the first frame according to the first downsampling ratio and then extracts feature points to obtain a first feature point set; the terminal device downsamples the second frame according to the first downsampling ratio and then extracts feature points to obtain the first feature point set. Two feature point sets; the terminal device generates the global low-precision registration information for transforming the second frame into the first frame according to the first feature point set and the second feature point set.
  • the terminal device downsamples the first frame and the second frame by using the same downsampling ratio, so that the correspondence of the generated images is better, and the computing power required for generating the global low-precision registration information is reduced.
  • the terminal device generates local high-precision registration information according to the feature points extracted after cropping the first frame and the second frame, specifically including: the terminal The device cuts the first frame according to the first area ratio, the position of the first center point and the first shape to obtain a first cut area, extracts feature points from the first cut area, and obtains a third set of feature points; the The first area ratio is the ratio of the area of the first cropping area to the total area of the first frame, the first shape is the shape of the first cropping area; the position of the first center point is the first cropping area The position of the center point relative to the center point of the first frame; the terminal device cuts the second frame according to the first area ratio, the first center point position and the first shape to obtain a second cut area , extract feature points from the second cropping area to obtain a fourth feature point set; the terminal device generates a transform from the second cropping area to the first feature point set according to the third feature point set and the fourth feature point set This
  • the terminal device uses the same cropping configuration to crop the first frame and the second frame, so that the correspondence of the generated images is better, and the computing power required for generating local high-precision registration information is reduced.
  • the first downsampling ratio is a preset downsampling ratio; or the first downsampling ratio is a downsampling ratio determined by the terminal device according to the real-time computing capability .
  • the first area ratio is a preset ratio; or the first area ratio is a ratio determined by the terminal device according to the real-time computing capability.
  • the first downsampling ratio or the first area ratio may be determined by the terminal device according to the real-time computing capability, so that even when the computing power of the terminal device is low, the deblurring process can be completed in real time.
  • the first center point location is the center point of the frame.
  • the center point of the frame is used as the center point of the crop, so that the resolution of the center area concerned by the user is not lost, the deblurring effect is the best, and the human-computer interaction performance of the terminal device is improved.
  • the first shape is a rectangle or a square.
  • a rectangle or a square is used as the cutting shape to make the matrix of feature points more regular during feature extraction and subsequent feature comparison, which reduces the need for correcting the registration information to obtain global high-precision registration information. computing power.
  • the terminal device acquiring the second frame collected by the second camera specifically includes: the terminal device sending a clear frame selection identifier to the second camera, the clear frame selecting The identifier includes time information and blur degree information of the first frame; the terminal device receives the second frame corresponding to the first frame fed back by the second camera.
  • the second camera selects the clear frame whose identification feedback matches the fuzzy frame according to the clear frame, which reduces the computing power requirement of the main processor in the terminal device.
  • the second frame is a frame collected by the second camera and the collection time interval of the first frame is within a first preset time period, and the degree of blur is compared. A frame in which the degree of blurring of the first frame does not exceed the preset blurring threshold.
  • the acquisition time interval between the second frame and the first frame is limited to be within the first preset time length and the blur degree does not exceed the preset blur threshold, instead of using the clearest frame collected by the second camera, which ensures that the When the second frame is merged into the first frame, the frame picture does not undergo too many transitions, which ensures the continuity of the final displayed frame picture and improves the consistency of the image clarity captured by the terminal device.
  • the present application provides a terminal device, the terminal device includes: a first activation module, configured to activate a first camera in response to a user's first operation; a second activation module, configured to detect the first camera When a camera is activated, a second camera is activated, wherein the second camera is equipped with OIS optical image stabilization; the first acquisition module is used to acquire the first frame collected by the first camera; the second acquisition module is used to acquire the second camera The second frame collected by the camera, the second frame corresponds to the first frame; the fusion module is used to fuse the second frame into the first frame to obtain a deblurred frame; the display module is used to display the deblurred frame Image.
  • the terminal device further includes: a first determination module, configured to determine that the first frame is a fuzzy frame; a second determination module, configured to determine that the second frame is a fuzzy frame clear frame.
  • the terminal device further includes: a third determination module, configured to determine whether the first camera is equipped with OIS when the first camera is activated; a third activation module , for starting the second camera when the third determining module determines that the first camera is not equipped with OIS.
  • the fusion module specifically includes: a registration unit for determining registration information for converting the second frame to the first frame; a fusion unit for According to the registration information, the second frame is fused to the first frame to obtain the deblurred frame.
  • the registration module specifically includes: a first registration subunit, configured to extract feature points after downsampling the first frame and the second frame , to generate global low-precision registration information; the second registration subunit is used to generate local high-precision registration information according to the feature points extracted after cutting the first frame and the second frame; the third registration subunit The unit is configured to use the local high-precision registration information to calibrate the global low-precision registration information to obtain global high-precision registration information, which is used as registration information for converting the second frame to the first frame.
  • the first registration subunit specifically includes: a first feature subunit, configured to extract features after downsampling the first frame according to a first downsampling ratio point to obtain the first feature point set; the second feature subunit is used to extract feature points after downsampling the second frame according to the first downsampling ratio to obtain the second feature point set; the global low-precision registration subunit , for generating the global low-precision registration information for transforming the second frame into the first frame according to the first feature point set and the second feature point set.
  • the second registration subunit specifically includes: a third feature subunit, configured to match the first area ratio, the first center point position and the first shape
  • the first frame is cropped to obtain a first cropped area, and feature points are extracted from the first cropped area to obtain a third set of feature points
  • the first area ratio is the area of the first cropped area and the first frame the ratio of the total area of
  • the feature subunit is used for cutting the second frame according to the first area ratio, the position of the first center point and the first shape to obtain a second cutting area, and extracting feature points from the second cutting area,
  • a fourth feature point set is obtained
  • a local high-precision registration subunit is used to generate the second cropping region transformed into the first cropping region according to the third feature point set and the fourth feature point set Local high-precision registration information.
  • the first downsampling ratio is a preset downsampling ratio; or the first downsampling ratio is a downsampling ratio determined by the terminal device according to the real-time computing capability .
  • the first area ratio is a preset ratio; or the first area ratio is a ratio determined by the terminal device according to the real-time computing capability.
  • the first center point location is the center point of the frame.
  • the first shape is a rectangle or a square.
  • the second acquisition module specifically includes: an identification sending unit, configured to send a clear frame selection identification to the second camera, the clear frame selection identification
  • the slave includes time information and blur degree information of the first frame;
  • a feedback receiving unit is configured to receive the second frame corresponding to the first frame fed back by the second camera.
  • the second frame is a frame collected by the second camera and the first frame is collected at a time interval within a first preset time period, and the degree of blur is comparable. A frame in which the degree of blurring of the first frame does not exceed the preset blurring threshold.
  • the present application provides a terminal device, the terminal device includes: one or more processors, a memory, a first camera, a second camera, and a display screen; the memory is coupled to the one or more processors, The memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors invoke the computer instructions to cause the terminal device to perform: in response to the first operation of the user, start the first camera; When the first camera is started, start the second camera, wherein the second camera is equipped with OIS; obtain the first frame collected by the first camera; obtain the second frame collected by the second camera, the second frame and the first frame. One frame corresponds; the second frame is fused to the first frame to obtain a deblurred frame; an image of the deblurred frame is displayed.
  • the one or more processors are further configured to invoke the computer instructions to cause the terminal device to execute: determine that the first frame is a fuzzy frame; determine the second frame Frames are clear frames.
  • the one or more processors are further configured to invoke the computer instructions to cause the terminal device to execute: determine whether the first camera is equipped with OIS; if the first camera is equipped with OIS; One camera is not equipped with OIS, activate the second camera.
  • the one or more processors are specifically configured to invoke the computer instruction to cause the terminal device to execute: determine the conversion of the second frame to the first frame registration information; according to the registration information, the second frame is fused to the first frame to obtain the deblurred frame.
  • the one or more processors are specifically configured to invoke the computer instructions to cause the terminal device to execute: according to downsampling the first frame and the second frame The feature points extracted later, generate global low-precision registration information; according to the feature points extracted after cropping the first frame and the second frame, generate local high-precision registration information; use the local high-precision registration information to calibrate The global low-precision registration information is obtained as global high-precision registration information, which is used as registration information for converting the second frame to the first frame.
  • the one or more processors are specifically configured to invoke the computer instructions to cause the terminal device to perform: downsampling the first frame according to a first downsampling ratio Then extract feature points to obtain a first feature point set; downsample the second frame according to the first downsampling ratio and extract feature points to obtain a second feature point set; according to the first feature point set and the second feature A set of points to generate the global low-precision registration information that transforms the second frame into the first frame.
  • the one or more processors are specifically configured to invoke the computer instructions to cause the terminal device to execute: according to the first area ratio, the first center point position and the first A shape is cut to the first frame to obtain a first cut area, and feature points are extracted from the first cut area to obtain a third set of feature points;
  • the first area ratio is the area of the first cut area and the The ratio of the total area of the first frame, the first shape is the shape of the first cropping area;
  • the position of the first center point is the position of the center point of the first crop area relative to the center point of the first frame According to this first area ratio, this first center point position and this first shape, this second frame is cut to obtain the second cut area, and the feature point is extracted to this second cut area to obtain the fourth feature point set; according to the third feature point set and the fourth feature point set, generate the local high-precision registration information for transforming the second cropping area into the first cropping area.
  • the first downsampling ratio is a preset downsampling ratio; or the first downsampling ratio is a downsampling ratio determined by the terminal device according to the real-time computing capability .
  • the first area ratio is a preset ratio; or the first area ratio is a ratio determined by the terminal device according to the real-time computing capability.
  • the position of the first center point is the center point of the frame.
  • the first shape is a rectangle or a square.
  • the one or more processors are specifically configured to invoke the computer instructions to cause the terminal device to execute: send a clear frame selection identifier to the second camera, the clear frame selection The frame selection identifier includes time information and blur degree information of the first frame; and receives the second frame corresponding to the first frame fed back by the second camera.
  • the second frame is a frame collected by the second camera and the first frame is collected at a time interval within a first preset time period, and the degree of blur is comparable. A frame in which the degree of blurring of the first frame does not exceed the preset blurring threshold.
  • an embodiment of the present application provides a chip system, the chip system is applied to a terminal device, the chip system includes one or more processors, and the processors are configured to invoke computer instructions to cause the terminal device to execute the first Aspects and methods described in any possible implementation of the first aspect.
  • an embodiment of the present application provides a computer program product containing instructions, when the computer program product is run on a terminal device, the terminal device is made to execute any of the first aspect and any possible implementation manner of the first aspect. method described.
  • an embodiment of the present application provides a computer-readable storage medium, including instructions, when the above-mentioned instructions are executed on a terminal device, the above-mentioned terminal device is made to execute the first aspect and any possible implementation manner of the first aspect method described.
  • the terminal device provided in the second aspect the terminal device provided in the third aspect, the chip system provided in the fourth aspect, the computer program product provided in the fifth aspect, and the computer storage medium provided in the sixth aspect are all used to execute The methods provided in the embodiments of the present application. Therefore, for the beneficial effects that can be achieved, reference may be made to the beneficial effects in the corresponding method, which will not be repeated here.
  • Fig. 1 is a schematic diagram of information flow for image processing
  • FIG. 2 is a schematic diagram of an information flow of an image processing method in an embodiment of the present application.
  • FIG. 3 is an exemplary comparison schematic diagram of the deblurring effect after fusion of clear frames and blurred frames of different definitions in the embodiment of the present application;
  • FIG. 4 is an exemplary comparison schematic diagram of images collected by a camera equipped with OIS and a camera without OIS in an embodiment of the present application;
  • FIG. 5 is a schematic diagram of an information flow for image processing in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of another information flow for image processing in an embodiment of the present application.
  • FIG. 7 is an exemplary schematic diagram of the hardware structure of the terminal device 100 in the embodiment of the present application.
  • FIG. 8 is a schematic flowchart of an image processing method in an embodiment of the present application.
  • FIG. 9 is an exemplary schematic diagram of down-sampling a frame and extracting feature points in an embodiment of the present application.
  • FIG. 10 is a schematic diagram of an exemplary scenario for generating low-precision registration information in an embodiment of the present application
  • FIG. 11 is a schematic diagram of an exemplary scene in which a frame is cropped and feature points are extracted in an embodiment of the present application;
  • FIG. 12 is a schematic diagram of an exemplary scenario for generating local high-precision registration information in an embodiment of the present application
  • FIG. 13 is a schematic diagram of an exemplary scene in which the clear frame Q1 is fused into the blurred frame M1 in the embodiment of the present application;
  • FIG. 16 is another schematic flowchart of the image processing method in the embodiment of the present application.
  • first and second are only used for descriptive purposes, and should not be construed as implying or implying relative importance or implying the number of indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, the “multiple” The meaning is two or more.
  • An embodiment of the present application provides an image processing method, which is used to improve the clarity of an image captured by a terminal device.
  • a video sequence can be input, and the fuzzy frame detection module can be entered first to determine which frames are fuzzy and which are clear; when determining that the current frame is a fuzzy frame, use The fuzzy frame generates a blur kernel; select a clear frame that best matches the blur frame, apply the blur kernel to the clear frame, and generate a new blur frame; perform block matching between the new blur frame and the original blur frame , and calculate the registration information; finally, according to the registration information, the new blurred frame is fused with the original blurred frame to obtain the deblurred frame. Repeat these steps many times to get the final deblurred video.
  • the effect is limited by the clarity of the clear frames in the current video sequence; on the other hand, during registration, the clear frames are first blurred, and then block matching is performed.
  • the complexity is extremely high, requiring multiple iterations to solve, and the computing power of the current mobile terminal equipment cannot support its real-time operation when processing high-definition images (such as 4K, 1080P resolution images).
  • the shooting in the embodiments of the present application may be photography or photography, which is not limited here.
  • FIG. 3 it is an exemplary comparison diagram of the deblurring effect of the deblurred frame obtained after fusion of the clear frame and the blurred frame with different definitions. It can be seen that the clearer the clear frame fused with the blurred frame, the better the deblurring effect on the blurred frame.
  • FIG. 4 it is a schematic diagram of an exemplary comparison of images captured by a camera equipped with OIS and a camera without OIS. It can be seen that the image captured by the camera equipped with OIS is clearer than that of the camera without OIS.
  • the terminal device not only searches for clear frames from a video sequence shot by a camera without OIS, but starts another camera with OIS when the camera starts up. Camera. From the frames captured by the camera with OIS, a clear frame matching the blurred frame can be found. Since the camera equipped with OIS can obtain more clear frames, the deblurring effect of the blurred frames can be better after the image processing method is adopted, so that the image captured by the terminal device has a higher consistency of definition.
  • the terminal device can, on the one hand, make the clear frame A and the blurred frame B fused. Downsampling to obtain the global low-precision registration information; on the other hand, the specific area corresponding to the clear frame A and the blurred frame B can be cropped to obtain local high-precision registration information; then use the local high-precision registration information to improve the The accuracy of the global low-precision registration information is obtained, and the global high-precision registration information is obtained; finally, the clear frame A and the blurred frame B are fused using the global high-precision registration information to obtain a deblurred frame, so that the blurred frame is replaced by a more accurate frame. Clear deblurred frames improve the clarity and consistency of images captured by terminal devices.
  • the global low-precision registration information is obtained by downsampling the clear frame and the fuzzy frame, which greatly reduces the amount of calculation required to obtain the global registration information.
  • Terminal devices can perform relevant calculations in real time.
  • only a small part of the local high-precision registration information is calculated after the clear frame and the blurred frame are cropped, which also greatly reduces the amount of calculation required to obtain the high-precision registration information between the clear frame and the blurred frame. So that the mobile terminal device can perform relevant calculations in real time. Therefore, after adopting the image processing method, the amount of calculation required for the mobile terminal to fuse clear frames and blurred frames is greatly reduced, and the mobile terminal can perform relevant processing in real time, so that the clarity consistency of the images captured by the terminal device is more consistent. high.
  • the terminal device can simultaneously open another camera equipped with OIS to start shooting, And perform blur frame detection on video frames input by two cameras at the same time.
  • a blurry frame is captured by a camera without OIS
  • a clear frame captured by a camera equipped with OIS that best matches the blurred frame can be selected.
  • the registration after cropping can obtain local high-precision registration information.
  • the local high-precision registration information is then used to correct the global low-precision registration information to obtain global high-precision registration information.
  • the clear frame is fused into the blurred frame by using the global high-precision registration information to obtain a deblurred frame, so that the blurred frame is replaced with a clearer deblurred frame, which improves the clarity consistency of the image captured by the terminal device.
  • the following describes the exemplary terminal device 100 provided by the embodiments of the present application.
  • FIG. 7 is a schematic structural diagram of a terminal device 100 provided by an embodiment of the present application.
  • the terminal device 100 may have more or less components than those shown in the figures, may combine two or more components, or may have different component configurations.
  • the various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • the terminal 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, an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, one or more cameras 193, Display screen 194 and subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • 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 terminal device 100 may include more or less components than those shown in the drawings, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), 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. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • graphics processor graphics processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the controller may be the nerve center and command center of the terminal device 100 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold 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 called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • 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, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • 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 that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may contain multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate with each other through the I2C bus interface, so as to realize the touch function of the terminal device 100 .
  • the I2S interface can be used for audio communication.
  • the processor 110 may contain 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 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can 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 may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is typically used to connect the processor 110 with the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can 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 peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 communicates with the camera 193 through the CSI interface, so as to realize the shooting function of the terminal device 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to implement the display function of the terminal device 100 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may 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 the like.
  • the GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the SIM interface can be used to communicate with the SIM card interface 195 to realize the function of transferring data to the SIM card or reading data in the SIM card.
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. This interface can also be used to connect other terminal devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the terminal device 100 .
  • the terminal device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the power management module 141 is used for connecting 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 charging 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 wireless communication function of the terminal device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in terminal device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the terminal device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • 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. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the terminal device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, perform frequency modulation on it, amplify it, and convert it into an electromagnetic wave for radiation through the antenna 2.
  • the antenna 1 of the terminal 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 terminal device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system, GLONASS
  • Beidou navigation satellite system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system, QZSS
  • SBAS satellite based augmentation systems
  • the terminal device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • Display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED diode AMOLED
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the terminal device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
  • the terminal device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used to process the data fed back by the camera 193 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto 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 transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the terminal device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • the one or N cameras 193 may include cameras equipped with OIS and cameras not equipped with OIS, which are not limited here.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, and the like.
  • Video codecs are used to compress or decompress digital video.
  • the terminal device 100 may support one or more video codecs.
  • the terminal device 100 can play or record videos in various encoding formats, for example, moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the terminal device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
  • RAM random access memories
  • NVM non-volatile memories
  • Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronization Dynamic random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, such as fifth-generation DDR SDRAM is generally called DDR5 SDRAM), etc.;
  • SRAM static random-access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • fifth-generation DDR SDRAM is generally called DDR5 SDRAM
  • Non-volatile memory may include magnetic disk storage devices, flash memory.
  • Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle, and can include single-level memory cells (single-level cells, SLC), multi-level memory cells (multi-level memory cells) according to the level of storage cell potential cell, MLC), triple-level cell (TLC), fourth-level storage unit (quad-level cell, QLC), etc., according to the storage specification can include universal flash storage (English: universal flash storage, UFS) , embedded multimedia memory card (embedded multi media Card, eMMC) and so on.
  • SLC single-level memory cells
  • multi-level memory cells multi-level memory cells
  • MLC multi-level memory cells
  • TLC triple-level cell
  • QLC fourth-level storage unit
  • UFS universal flash storage
  • eMMC embedded multimedia memory card
  • the random access memory can be directly read and written by the processor 110, and can be used to store executable programs (eg, machine instructions) of an operating system or other running programs, and can also be used to store data of users and application programs.
  • executable programs eg, machine instructions
  • the random access memory can be directly read and written by the processor 110, and can be used to store executable programs (eg, machine instructions) of an operating system or other running programs, and can also be used to store data of users and application programs.
  • the non-volatile memory can also store executable programs and store data of user and application programs, etc., and can be loaded into the random access memory in advance for the processor 110 to directly read and write.
  • the external memory interface 120 can be used to connect an external non-volatile memory, so as to expand the storage capacity of the terminal device 100 .
  • the external non-volatile memory communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video, etc. files in external non-volatile memory.
  • the terminal device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
  • the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also referred to as a "speaker" is used to convert audio electrical signals into sound signals.
  • the terminal device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also referred to as "earpiece" is used to convert audio electrical signals into sound signals.
  • the terminal device 100 answers a call or a voice message, the voice can be answered by placing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through a human mouth, and input the sound signal into the microphone 170C.
  • the terminal device 100 may be provided with at least one microphone 170C.
  • the terminal device 100 may be provided with two microphones 170C, which may implement a noise reduction function in addition to collecting sound signals.
  • the terminal device 100 may further be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
  • the earphone jack 170D is used to connect wired earphones.
  • the earphone interface 170D may be the USB interface 130, or may be a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
  • the pressure sensor 180A may be provided on the display screen 194 .
  • the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
  • the terminal device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the terminal device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the motion attitude of the terminal device 100 .
  • the angular velocity of the end device 100 about three axes ie, the x, y and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shaking angle of the terminal device 100, calculates the distance to be compensated by the lens module according to the angle, and allows the lens to offset the shaking of the terminal device 100 through reverse motion to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
  • the air pressure sensor 180C is used to measure air pressure.
  • the terminal device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the terminal device 100 can detect the opening and closing of the flip holster using the magnetic sensor 180D.
  • the terminal device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the terminal device 100 is stationary. It can also be used to identify the posture of terminal devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the terminal device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the terminal device 100 emits infrared light to the outside through the light emitting diode.
  • the terminal device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100 . When insufficient reflected light is detected, the terminal device 100 may determine that there is no object near the terminal device 100 .
  • the terminal device 100 can use the proximity light sensor 180G to detect that the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • Proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in a pocket, so as to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the terminal device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering incoming calls with fingerprints, and the like.
  • the temperature sensor 180J is used to detect the temperature.
  • the terminal device 100 uses the temperature detected by the temperature sensor 180J to execute the temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal device 100 performs a reduction in the performance of the processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection.
  • the terminal device 100 when the temperature is lower than another threshold, the terminal device 100 heats the battery 142 to avoid abnormal shutdown of the terminal device 100 caused by the low temperature.
  • the terminal device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to touch operations may be provided through display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the terminal device 100 , which is different from the position where the display screen 194 is located.
  • the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
  • the terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100 .
  • Motor 191 can generate vibrating cues.
  • the motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • the motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be contacted and separated from the terminal device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
  • the terminal device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the terminal device 100 interacts with the network through the SIM card to realize functions such as calls and data communication.
  • the processor 110 may call the operation instruction stored in the internal memory 121 according to the image obtained by the camera 194, execute the image processing method in the embodiment of the present application, and improve the clarity of the image captured by the terminal device , and sent to the display screen 194 for display.
  • the terminal device A has one front camera and two rear cameras.
  • the 2 rear cameras are: the main camera with high-definition image capture and equipped with OIS, and the wide-angle lens with a wide viewing angle and a short focal length. If the user needs to take high-definition photos or videos, the main camera can be turned on for shooting; if the user needs to take photos or videos with a wider range of images, the wide-angle camera can be turned on for shooting.
  • the main camera and the wide-angle camera will be used separately according to the user's choice.
  • the wide-angle camera is activated to shoot, so as to obtain a photo or video with a wide screen range. If the user needs to shoot higher-definition photos or videos, the shooting mode needs to be adjusted to the high-definition shooting mode. At this time, the terminal device A will turn off the wide-angle camera and switch to start the main camera for shooting.
  • the photos or videos taken at this time have a higher resolution. But the picture area is smaller.
  • the terminal device A when the terminal device A starts the wide-angle camera by default for shooting, the main camera will be started at the same time, and a text prompt box may be displayed on the display screen to prompt the user: "The main camera will be used at the same time.
  • the camera improves the clarity of the picture captured by the wide-angle camera.”
  • the terminal device A will start the main camera when the wide-angle camera is working, and use the higher-definition frames collected by the main camera to deblur the blurred frames collected by the wide-angle camera, so that the final captured picture is clearer and wider. wide.
  • the terminal device A has one front camera and three rear cameras.
  • the 3 rear cameras are: the main camera with high image definition and equipped with OIS, the wide-angle lens with wide viewing angle and short focal length, and the telephoto camera with small viewing angle and long focal length. If the user needs to shoot high-definition photos or videos, the main camera can be turned on to shoot; if the user needs to shoot photos or videos with a wider range, the wide-angle camera can be turned on; if the user needs to shoot farther scenes, The telephoto camera can be turned on for shooting.
  • the main camera, wide-angle camera and telephoto camera will be used separately according to the user's choice.
  • the wide-angle camera is activated to shoot, so as to obtain a photo or video with a wide screen range.
  • the shooting mode needs to be adjusted to the high-definition shooting mode.
  • the terminal device A will turn off the wide-angle camera and switch to start the main camera for shooting.
  • the photos or videos taken at this time have a higher resolution. But the picture area is smaller.
  • the terminal device A will turn off other cameras and switch to start the telephoto camera for shooting. At this time, the scene with a farther distance can be shot, but the photos or videos with small viewing angles and low resolution.
  • the terminal device A when the terminal device A starts the wide-angle camera by default for shooting, the main camera will be started at the same time, and a text prompt box may be displayed on the display screen to prompt the user: "The main camera will be used at the same time.
  • the camera improves the clarity of the picture captured by the wide-angle camera.”
  • the terminal device A will start the main camera when the wide-angle camera is working, and use the higher-definition frames collected by the main camera to deblur the blurred frames collected by the wide-angle camera, so that the final captured picture is clearer and wider. wide.
  • the terminal device A starts the telephoto camera, it can start the main camera at the same time, and a text prompt box can be displayed on the display screen to prompt the user: "The telephoto camera will be used at the same time.
  • the main camera improves the clarity of the picture captured by the telephoto camera.”
  • Terminal device A will start the main camera when the wide-angle camera is working, and use the higher-definition frames collected by the main camera to deblur the blurred frames collected by the telephoto camera, so that not only farther scenes can be captured, but also The picture is very clear.
  • the terminal device A has one front camera and four rear cameras.
  • the 4 rear cameras are: the main camera with high image definition and equipped with OIS, the wide-angle lens with wide viewing angle and short focal length, the telephoto camera with small viewing angle and long focal length and equipped with OIS 1, the long focal length camera Focus camera 2.
  • the main camera can be turned on to shoot; if the user needs to shoot photos or videos with a wider range, the wide-angle camera can be turned on; if the user needs to shoot farther scenes,
  • the telephoto camera 1 can be turned on for shooting; if the user needs to shoot a scene with a farther distance, the telephoto camera 2 can be turned on for shooting.
  • the main camera, wide-angle camera, telephoto camera 1 and telephoto camera 2 will be used independently according to the user's choice.
  • the wide-angle camera is activated to shoot, so as to obtain a photo or video with a wide screen range. If the user needs to shoot higher-definition photos or videos, the shooting mode needs to be adjusted to the high-definition shooting mode. At this time, the terminal device A will turn off the wide-angle camera and switch to start the main camera for shooting.
  • the photos or videos taken at this time have a higher resolution. But the picture area is smaller. If the user needs to shoot a distant scene, it needs to be adjusted to the telephoto mode.
  • the terminal device A will turn off other cameras and switch to start the telephoto camera 1 for shooting.
  • the distant scene can be photographed; if the user If you need to shoot a scene with a farther distance, you need to adjust to the ultra-telephoto shooting mode.
  • the terminal device A will turn off other cameras and switch to start the telephoto camera 2 to shoot. photos or videos with small viewing angles and low resolution.
  • the terminal device A when the terminal device A starts the wide-angle camera by default for shooting, the main camera will be started at the same time, and a text prompt box may be displayed on the display screen to prompt the user: "The main camera will be used at the same time.
  • the camera improves the clarity of the picture captured by the wide-angle camera.”
  • the terminal device A will start the main camera when the wide-angle camera is working, and use the higher-definition frames collected by the main camera to deblur the blurred frames collected by the wide-angle camera, so that the final captured picture is clearer and wider. wide.
  • the terminal device A starts the telephoto camera 2, it can start the telephoto camera 1 at the same time, and a text prompt box can be displayed on the display screen to remind the user: "The telephoto camera 1 will be used at the same time to improve the clarity of the images captured by the telephoto camera 2".
  • the terminal device A will start the telephoto camera 2 to work, and use the higher-definition frames collected by the telephoto camera 1 to deblur the blurred frames collected by the telephoto camera 2, so that it can not only shoot To the farther scene and the picture is very clear.
  • the terminal device A has one front camera and three rear cameras.
  • the 3 rear cameras are: the main camera with high definition image capture, the wide-angle lens with wide viewing angle and short focal length, and the anti-shake camera equipped with OIS. If the user needs to shoot high-definition photos or videos, the main camera can be turned on to shoot; if the user needs to shoot photos or videos with a wider range, the wide-angle camera can be turned on; if the user needs to shoot scenes in motion, they can be turned on Anti-shake camera for shooting.
  • the main camera, wide-angle camera, and anti-shake camera will be used separately according to the user's choice.
  • the wide-angle camera is activated to shoot, so as to obtain a photo or video with a wide screen range. If the user needs to shoot higher-definition photos or videos, the shooting mode needs to be adjusted to the high-definition shooting mode. At this time, the terminal device A will turn off the wide-angle camera and switch to start the main camera for shooting. The photos or videos taken at this time have a higher resolution. But the picture area is smaller. If the user needs to shoot in motion, it needs to be adjusted to anti-shake mode. At this time, terminal device A will turn off other cameras and switch to activate the anti-shake camera for shooting, which can keep the picture stable when shooting in motion.
  • the anti-shake camera when the terminal device A starts the wide-angle camera by default to shoot, the anti-shake camera will be started at the same time, and a text prompt box may be displayed on the display screen to remind the user: "The simultaneous use of The anti-shake camera improves the clarity of the picture captured by the wide-angle camera.”
  • Terminal device A will start the anti-shake camera when the wide-angle camera is working, and use the stable-definition frames collected by the anti-shake camera to deblur the blurred frames collected by the wide-angle camera, so that the final captured picture is clearer and more stable. .
  • the terminal device A will start the anti-shake camera at the same time when starting the main camera to shoot, and can display a text prompt box on the display screen to remind the user: " The anti-shake camera will be used at the same time to improve the stability of the main camera.”
  • Terminal A will start the anti-shake camera when the main camera is working, and use the stable-definition frames collected by the anti-shake camera to deblur the blurred frames collected by the main camera, so that the final captured picture is clearer and more stable. .
  • the terminal device may have more or less cameras, and these cameras may also have various other functions. There are no restrictions.
  • the terminal device includes a camera A with a wide-angle lens without OIS and a camera B with an anti-shake function equipped with OIS, and the user starts the camera A to shoot.
  • FIG. 8 is a schematic flowchart of an image processing method in an embodiment of the present application:
  • the terminal device turns on the camera A that is not equipped with OIS;
  • the operation A may be clicking the photo shooting control, or clicking the video recording control, or other combined operations that can trigger the start of shooting, etc., which are not limited here; the photo shooting control or the video recording control may be a terminal.
  • the controls in the software preset by the device at the factory may also be the controls in third-party software, which is not limited here.
  • the user wants to shoot the external scenery, so he can open the recording software, click to start recording as operation A, and trigger the interrupt device to turn on the camera A with a wide-angle lens without OIS to shoot the surrounding scenery.
  • the terminal device caches the 5-frame video sequence shot by the camera A in real time, which is recorded as X1;
  • camera A After the terminal device turns on camera A, camera A can shoot video frames to obtain video sequences.
  • the terminal device may cache the video sequence captured by the camera A in real time.
  • the terminal device buffers the 5-frame video sequence captured by the camera A as an example, and the 5-frame video sequence buffered in real time is denoted as X1. It can be understood that, in practical applications, the terminal device may buffer video sequences of more or less frames captured by the camera A in real time, which is not limited here.
  • the terminal device can buffer multiple frames as a video sequence when recording or taking pictures. The difference is that in the case of taking a photo, the terminal device can finally select an optimal frame from the video sequence as a photo.
  • the terminal device activates the camera B equipped with OIS;
  • the terminal device when it is detected that the camera A that is not equipped with the OIS is activated, the terminal device will activate the camera B that is equipped with the OIS.
  • the terminal device may first determine whether the activated camera is equipped with OIS, and when it is determined that the activated camera A is not equipped with OIS, the terminal device will start the camera B equipped with OIS.
  • the camera B equipped with OIS can shoot a clearer frame picture than the camera A without OIS.
  • the frame picture captured by camera A may not be as clear as the frame picture captured by camera B, because camera A has a wide-angle lens, the frame picture captured by camera A may cover a wider range of scenery and a sense of spatial depth. Possibly stronger. Therefore, the two cameras have different functions and functions to meet the needs of users, and the frames captured by one camera will not be used to completely replace the frames captured by the other camera.
  • the camera A may also be referred to as a first camera
  • the camera B may also be referred to as a second camera, which is not limited herein.
  • the terminal device caches the 5-frame video sequence shot by the camera B in real time, which is recorded as X2;
  • the camera B can shoot video frames to obtain a video sequence.
  • the terminal device may cache the video sequence shot by the camera B in real time.
  • the terminal device buffers the 5-frame video sequence captured by the camera B as an example, and the 5-frame video sequence buffered in real time is denoted as X2. It can be understood that, in practical applications, the terminal device may buffer video sequences of more or less frames captured by the camera B in real time, which is not limited here.
  • the terminal device starts the camera to capture images, and after caching the captured frames to obtain a video sequence, the frames in the video sequence are displayed in a certain time sequence.
  • the terminal device may sequentially display the 5 frames in X1 in the order of the shooting time from early to late. If the current frame to be displayed is called the current frame D1, and assuming that the middlemost frame of X1 is the current frame D1 at this time, the terminal device can first determine whether the current frame D1 is a clear frame.
  • a frame is a fuzzy frame or a clear frame
  • relevant methods in the prior art may be used, such as judging the change curve of the color level between consecutive pixels, judging the degree of sharpening, etc., which will not be repeated here.
  • the terminal device may determine that the current frame D1 is a blurry frame ; if the current frame does not meet the first preset condition, the terminal device may determine that the current frame D1 is a clear frame.
  • the terminal device may determine that the current frame D1 is clear frame; if the current frame does not meet the second preset condition, the terminal device can determine that the current frame D1 is a fuzzy frame;
  • the terminal device may determine that the current frame D1 is a fuzzy frame; if the current frame meets the fourth preset condition, the terminal device may determine that the current frame D1 is a clear frame.
  • step S816 when the terminal device determines that the current frame D1 is a clear frame, step S816 may be performed; when it is determined that the current frame D1 is not a clear frame, step S806 may be performed.
  • step S806 may not be performed, and subsequent steps of step S806 may be directly performed, which is not limited herein.
  • the terminal device determines that the current frame D1 is a fuzzy frame, which is recorded as a fuzzy frame M1;
  • the terminal device can determine that the current frame D1 is a fuzzy frame, which is implemented in this application. In the example, it can be recorded as blur frame M1.
  • subsequent steps S807, S808, and S810 may be performed. It can be understood that the terminal device can execute these steps synchronously according to the computing power and execution speed, etc., or execute these steps in a certain order, or dynamically adjust the steps of these steps in real time during the execution process.
  • the execution order and the like are not limited here.
  • the terminal device selects a clear frame Q1 matching the fuzzy frame M1 from X2;
  • the terminal device After the terminal device determines that the current frame D1 is the blurred frame M1, it can select a clear frame Q1 that matches the blurred frame M1 and is clear from the video sequence X2 captured and buffered by the camera B.
  • the terminal device may send a clear frame selection identifier to the camera B, and the camera B determines a matching and clear clear frame Q1.
  • the clear frame selection identifier may carry time information and blur degree information of the blurred frame M1, and the like.
  • the determined clear frame Q1 may be a frame in the video sequence X2 whose sharpness does not exceed the blur degree threshold compared with the blurred frame M1, and whose acquisition time is closest to the acquisition time of the blurred frame M1, or
  • the acquisition time and the acquisition time of the fuzzy frame M1 are one frame within the first preset duration.
  • the rule for selecting which frame in the video sequence X2 is the clear frame Q1 that matches the fuzzy frame M1 can be determined according to actual needs, or can refer to the prior art to select a clear frame matching the target frame from a video sequence
  • the relevant rules of the frame are not limited here.
  • the terminal device downsamples the fuzzy frame M1, and extracts the feature point T1;
  • downsampling also known as downsampling, that is, reducing the resolution of the image
  • downsampling can significantly reduce the computing power required to perform related calculations on the image.
  • the size of an image I is M*N
  • it is down-sampled by s times that is, a resolution image of (M/s)*(N/s) size is obtained, where s is generally the difference between M and N. common divisor.
  • s is generally the difference between M and N. common divisor.
  • For an image in matrix form it is equivalent to turning the image in the s*s window of the original image into a pixel, and the value of this pixel is the mean of all pixels in the window.
  • a feature point may refer to a point where the gray value of the image changes drastically or a point with a large curvature on the edge of the image (ie, the intersection of two edges).
  • Image feature points can play a role in feature point-based image matching algorithms.
  • Image feature points can reflect the essential characteristics of the image and can identify the target object in the image.
  • Image matching can be accomplished by matching feature points.
  • the first downsampling ratio at which the terminal device downsamples the fuzzy frame M1 may be a preset downsampling ratio, or may be a downsampling ratio determined according to the current computing capability of the terminal device, which is not limited here.
  • the relevant feature point extraction method in the prior art can be used to extract feature points from the down-sampled image to obtain the feature point T1, which will not be repeated here.
  • FIG. 9 it is an exemplary schematic diagram of down-sampling a frame and extracting feature points.
  • the size of 10*10 fuzzy frame M1 is down-sampled by 2 times, and a 5*5 picture can be obtained, and feature points of the picture can be extracted to obtain a matrix set [T1] describing the feature points of the image.
  • the terminal device downsamples the clear frame Q1, and extracts the feature point T2;
  • step S808 This is similar to the manner of down-sampling and feature extraction in step S808, and details are not described here.
  • step S809 adopts the same first downsampling ratio as that in step S808.
  • the terminal device generates global low-precision registration information H1 according to the feature point T1 and the feature point T2;
  • Image registration is the process of matching and superimposing two or more images acquired at different times, different sensors or under different weather conditions.
  • the registration process can generally be carried out in the following ways: first, extract feature points from two images to obtain feature points; find matching feature point pairs through similarity measurement; then obtain image space coordinate transformation parameters through the matched feature point pairs; Transform parameters for image registration.
  • a matrix of image space coordinate transformation parameters for transforming a clear frame to a blurred frame is called registration information.
  • the methods for generating low-precision registration information and generating high-precision registration information may be the same. Just because the fuzzy frame M1 and the clear frame Q1 are down-sampled, the extracted feature points are relatively few. Therefore, the generated registration information is called global low-precision registration information H1.
  • FIG. 10 it is a schematic diagram of an exemplary scene for generating low-precision registration information.
  • the extracted feature point T1 For the 5*5 picture obtained by downsampling the 10*10 fuzzy frame M1, the extracted feature point T1, and the 4*4 picture obtained by downsampling the 8*8 clear frame Q1, the extracted feature point T2, The similarity measurement is performed to find the matched feature point pairs, and then the global low-precision registration information H1 transformed from the clear frame Q1 to the fuzzy frame M1 can be obtained by calculating the matched feature point pairs.
  • the terminal device cuts the fuzzy frame M1, and extracts the feature point T3;
  • cropping the frame means reducing the picture size of the frame without reducing the resolution of the frame (without losing the definition).
  • the terminal device may crop the fuzzy frame M1 according to the first area ratio, the first center point position and the first shape, blur the cropped area, and extract feature points from the fuzzy cropped area , get the feature point T3.
  • the first area ratio is the ratio of the area of the fuzzy cropped area to the total area of the fuzzy frame
  • the first shape is the shape of the fuzzy cropped area
  • the position of the first center point is the center of the fuzzy cropped area The position of the point relative to the center point of this blur frame.
  • the center area of the frame is cropped, that is, the position of the first center point is the center point of the frame. It can be understood that, according to the actual situation, other positions in the frame picture can also be selected for cropping, which is not limited here.
  • the first area ratio may be a preset ratio, or may be a ratio determined by the terminal device according to the real-time computing capability, which is not limited here.
  • the first shape may be square or rectangular. It can be understood that, according to the actual situation, pictures of other shapes can also be obtained by cutting, which is not limited here.
  • the first area ratio may be 1/4 for cropping. It can be understood that, according to the actual situation, a larger or smaller picture can also be cropped. There is no limitation here.
  • FIG. 11 it is a schematic diagram of an exemplary scene in which a frame is cropped and feature points are extracted.
  • the picture in the central area of 5*5 can be cropped, and feature points can be extracted from the picture to obtain a matrix set [T3] describing the feature points of the image.
  • the terminal device cuts the clear frame Q1, and extracts the feature point T4;
  • the terminal device may cut the clear frame Q1 according to the first area ratio, the first center point position and the first shape to obtain a clear cut area, and extract features from the clear cut area point to get the feature point T4.
  • the first area ratio is the ratio of the area of the clear cut area to the total area of the clear frame
  • the first shape is the shape of the clear cut area
  • the position of the first center point is the center of the clear cut area The position of the point relative to the center point of this sharp frame.
  • step S812 the first area ratio, the first center point position, and the first shape in step S812 are the same as those in step S812.
  • feature points T1 , feature points T2 , feature points T3 , and feature points T4 in the embodiments of the present application may all be feature point sets.
  • the terminal device generates local high-precision registration information h2 according to the feature point T3 and the feature point T4;
  • the terminal device can generate registration information h2 for transforming the image space of the picture cut out by the clear frame Q1 into the image space of the picture cut out by the fuzzy frame M1.
  • FIG. 12 it is a schematic diagram of an exemplary scene for generating local high-precision registration information.
  • the similarity measurement is performed to find the matching feature point pair, and then the local height of the picture obtained from the picture cropped from the clear frame Q1 to the picture cropped by the fuzzy frame M1 can be calculated through the matched feature point pair.
  • the terminal device uses the local high-precision registration information h2 to correct the global low-precision registration information H1, and obtains the global high-precision registration information H3;
  • the terminal device can correct the global low-precision registration information H1 according to the local high-precision registration information h2 to improve the accuracy of the global low-precision registration information, thereby obtaining the global high-precision registration information H3.
  • the registration information H1 , h1 , and H3 are matrices composed of registration information of each of the multiple pictures in the entire picture.
  • the registration information of the i-th picture represented in H1 is marked as Hi; the registration information of the i-th picture represented in h2 is marked as hi; the registration information of the j-th picture around Hi is marked as Hj ; denote the weight of the registration information of the ith block as ⁇ i; denote the spatial consistency hyperparameter as ⁇ ; denote H3 as Using the following formula 1, by approximating the value of hi to H i and making the value of H j approximate to the value of the surrounding Hi , we can obtain this
  • the terminal device uses the global high-precision registration information H3 to fuse the clear frame Q1 with the blurred frame M1 to obtain a deblurred frame F1;
  • the terminal device can use the H3 to fuse the clear frame Q1 into the blurred frame M1 to obtain the deblurred frame F1.
  • FIG. 13 it is a schematic diagram of an exemplary scene in which the clear frame Q1 is fused to the blurred frame M1.
  • each image block in the clear frame Q1 can be transformed to the corresponding position in the blurred frame M1, and fused into the blurred frame M1, thereby obtaining the deblurred frame F1.
  • the terminal device displays the image of the deblurred frame or the image of the clear frame in X1;
  • step S805 the terminal device determines that the current frame in X1 is a clear frame, or in step S805, the terminal device determines that the current frame in X1 is a blurred frame, and after subsequent processing of the blurred frame into a de-blurred frame, the terminal device can Displays an image of that deblurred frame or an image of the clear frame in X1.
  • the terminal device when the camera started for shooting does not have OIS, the terminal device can simultaneously start the camera with OIS, and use the clear frame captured by the camera with OIS to perform deblurring processing on the blurred frame without OIS, which can be The deblurring effect of the terminal device on the blurred frame is better, so that the definition consistency of the picture displayed by the terminal device is higher.
  • the terminal device downsamples the clear frame and the blurred frame respectively, and then extracts the feature point matching to obtain the global low-precision registration information, and extracts the feature point matching after cutting respectively to obtain the local high-precision registration information.
  • the terminal Even if the device is a mobile terminal device, it is possible to perform real-time deblurring processing, so that the image captured by the mobile terminal device has higher consistency in definition.
  • the terminal device includes a camera C, and the camera C is configured with OIS, or the camera C is not configured with OIS and the terminal device does not have a camera configured with OIS. The user starts the camera C to shoot.
  • FIG. 14 is another schematic flowchart of the image processing method in the embodiment of the present application:
  • the camera C may also be called a second camera, which is not limited here.
  • the terminal device caches the 5-frame video sequence captured by the camera C in real time, which is recorded as X3;
  • Steps S1401-S1402 are similar to steps S801-S802, and will not be repeated here.
  • the terminal device determines that the current frame D1 is a fuzzy frame, which is denoted as a fuzzy frame M1;
  • Steps S1403-S1404 are similar to steps S805-S806, and are not repeated here.
  • the terminal device selects a clear frame Q1 matching the fuzzy frame M1 from X3;
  • a frame Q1 that matches the blurred frame M1 and is clear may be selected from the video sequence X3 captured by the camera C and buffered.
  • the determined clear frame Q1 may be a frame in the video sequence X3 whose sharpness does not exceed the blur degree threshold compared with the blurred frame M1 and whose time is closest to the acquisition time of the blurred frame M1.
  • the determined clear frame Q1 may be that the definition in the video sequence X3 does not exceed the blur degree threshold compared with the blurred frame M1, and the acquisition time interval between the acquisition time and the blurred frame M1 is within the first predetermined time interval. Set a frame within the duration.
  • the rule for selecting which frame in the video sequence X3 is to be the clear frame Q1 that matches the fuzzy frame M1 can be determined according to actual needs, or can refer to the prior art to select a clear frame matching the target frame from a video sequence
  • the relevant rules of the frame are not limited here.
  • steps S1401 to S1405 can be performed in the order.
  • the terminal device downsamples the fuzzy frame M1, and extracts the feature point T1;
  • the terminal device downsamples the clear frame Q1, and extracts the feature point T2;
  • the terminal device generates global low-precision registration information H1 according to the feature point T1 and the feature point T2;
  • the terminal device cuts the fuzzy frame M1, and extracts the feature point T3;
  • the terminal device cuts the clear frame Q1, and extracts the feature point T4;
  • the terminal device generates local high-precision registration information h2 according to the feature point T3 and the feature point T4;
  • the terminal device uses the local high-precision registration information h2 to correct the global low-precision registration information H1, and obtains the global high-precision registration information H3;
  • the terminal device uses the global high-precision registration information H3 to fuse the clear frame Q1 and the blurred frame M1 to obtain a deblurred frame F1;
  • the terminal device displays the image of the deblurred frame or the image of the clear frame in X3;
  • Steps S1406-S1414 are similar to steps S808-S816, and can participate in the description of steps S808-S816, and are not repeated here.
  • the terminal device can perform deblurring processing on the blurred frames in the video sequence captured by a camera, so that the picture displayed by the terminal device has higher consistency in definition.
  • the terminal device downsamples the clear frame and the blurred frame respectively, extracts feature points for matching to obtain global low-precision registration information, and extracts feature points after cutting respectively to obtain local high-precision registration information.
  • the terminal Even if the device is a mobile terminal device, it is possible to perform real-time deblurring processing, so that the image captured by the mobile terminal device has higher consistency in definition.
  • the image processing methods in the embodiments shown in FIG. 8 and FIG. 14 may also be used in combination.
  • the terminal device can determine whether the activated camera is equipped with OIS; when it is determined that the activated camera is equipped with OIS, for example, the activated camera A, the terminal device can execute the image processing method according to the embodiment shown in FIG. 8 : when it is determined that the activated camera is equipped with OIS When the activated camera A is not equipped with OIS, activate the camera B equipped with OIS; when it is determined that the activated camera is not equipped with OIS, for example, the activated camera C is not equipped with OIS, the terminal device can follow the embodiment shown in Figure 14.
  • the embodiment of the present application further provides another image processing method:
  • the terminal device activates the camera B, and the camera B is equipped with OIS;
  • the terminal device when it is detected that the camera A is activated, the terminal device may directly activate the camera B.
  • the terminal device may determine whether the camera A is equipped with OIS; if equipped with OIS, the terminal device will activate the camera B.
  • the terminal device obtains the first frame collected by the camera A;
  • the terminal device determines that the first frame is an ambiguous frame before performing the subsequent steps.
  • the terminal device acquires the second frame collected by the camera B, where the second frame corresponds to the first frame;
  • the terminal device may determine whether the frame collected by the camera B is a clear frame, and only use the clear frame as the second frame corresponding to the first frame when the collected frame is a clear frame.
  • steps S1501-S1503 reference may be made to the descriptions in the above-mentioned steps S801-S807, which will not be repeated here.
  • the terminal device fuses the second frame into the first frame to obtain a deblurred frame
  • the terminal device may first determine the registration information transformed from the second frame to the second frame, and then fuse the second frame into the first frame according to the registration information to obtain a deblurred frame.
  • the terminal device obtains the registration information H4:
  • the second frame may be directly registered with the first frame to obtain the registration information H4;
  • the second frame and the first frame may be down-sampled first, and then registered to obtain the registration information H4;
  • the registration may be performed in the manner with reference to the above steps S808-S814.
  • the registration information H4 can also be obtained in other ways, which are not limited here.
  • the terminal device displays the image of the deblurred frame.
  • the terminal device when the terminal device starts the camera A to shoot, the terminal device can simultaneously start the camera B with the OIS, and use the clear frames collected by the camera B with the OIS to perform deblurring processing on the blurred frames collected by the camera A,
  • the deblurring effect of the terminal device on the blurred frame can be better, so that the definition consistency of the picture displayed by the terminal device is higher.
  • the embodiment of the present application further provides another image processing method:
  • the terminal device obtains the fuzzy frame M1 and the clear frame Q1;
  • the sources of the fuzzy frame M1 and the clear frame Q1 can be various:
  • the terminal device may obtain the fuzzy frame M1 and the clear frame Q1 according to steps S801-S807;
  • the terminal device may obtain the fuzzy frame M1 and the clear frame Q1 according to steps S1401-S1405;
  • the fuzzy frame M1 and the clear frame Q1 can be specified by the user
  • the fuzzy frame M1 and the clear frame Q1 may be obtained by the terminal device from the user's album according to default rules
  • the terminal device downsamples the fuzzy frame M1, and extracts the feature point T1;
  • the terminal device downsamples the clear frame Q1, and extracts the feature point T2;
  • the terminal device generates global low-precision registration information H1 according to the feature point T1 and the feature point T2;
  • the terminal device cuts the fuzzy frame M1, and extracts the feature point T3;
  • the terminal device cuts the clear frame Q1, and extracts the feature point T4;
  • the terminal device generates local high-precision registration information h2 according to the feature point T3 and the feature point T4;
  • the terminal device uses the local high-precision registration information h2 to correct the global low-precision registration information H1, and obtains the global high-precision registration information H3;
  • the terminal device uses the global high-precision registration information H3 to fuse the clear frame Q1 and the blurred frame M1 to obtain a deblurred frame F1;
  • the terminal device displays the image of the deblurred frame F1.
  • Steps S1602-S1610 are similar to steps S808-S816, and reference may be made to the descriptions in steps S808-S816, which will not be repeated here.
  • the terminal device when performing deblurring processing, downsamples the clear frame and the blurred frame, respectively, and then extracts feature points for matching to obtain global low-precision registration information. registration information, and then use the local high-precision registration information to calibrate the global low-precision registration information to obtain the global high-precision information required for deblurring processing, which greatly reduces the computing power required for image registration. Even if the terminal device is a mobile terminal device, it is possible to implement real-time deblurring processing, so that the image captured by the mobile terminal device has higher definition consistency.
  • the term “when” may be interpreted to mean “if” or “after” or “in response to determining" or “in response to detecting" depending on the context.
  • the phrases “in determining" or “if detecting (the stated condition or event)” can be interpreted to mean “if determining" or “in response to determining" or “on detecting (the stated condition or event)” or “in response to the detection of (the stated condition or event)”.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.
  • the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium.
  • the program When the program is executed , which may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

一种图像处理方法。在该方法中,终端设备启动第一摄像头进行拍摄时,终端设备可以同时启动具备有OIS的第二摄像头,使用具备有OIS的第二摄像头采集的清晰帧对第一摄像头采集的模糊帧进行去模糊处理,使得终端设备对模糊帧的去模糊效果更好,从而使得终端设备显示的拍摄画面的清晰度一致性更高。

Description

图像处理方法和终端设备
本申请要求于2021年04月14日提交中国专利局、申请号为202110402621.2、申请名称为“图像处理方法和终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端及图像处理技术领域,尤其涉及图像处理方法和终端设备。
背景技术
当前使用终端设备在低亮场景下进行拍摄时,由于人手拿着终端设备一直在移动,在录制的视频中会出现部分帧清晰部分帧模糊的现象,从而导致帧间清晰度不一致,会给用户形成一种视频画面在不断的“震颤”的视觉感受,体验极差。
一般为了抑制这样现象,可以给智能终端的摄像头会配备一个光学防抖(optical image stabilization,OIS)的物理器件。OIS可以有效缓解帧间清晰度不一致的问题,但不能完全解决该问题。并且在考虑智能终端成本等情况下,一般只会给常用的摄像头配备OIS,而其他镜头不会配备。
因此,如何提升终端设备拍摄出的图像的清晰度一致性,依然还是一个亟待解决的问题。
发明内容
本申请提供了一种图像处理方法,用于提升终端设备拍摄出的图像的清晰度一致性。
第一方面,本申请提供了一种图像处理方法,包括:响应于用户的第一操作,终端设备启动第一摄像头;在检测到该第一摄像头启动时,该终端设备启动第二摄像头,其中该第二摄像头配备OIS光学防抖;该终端设备获取该第一摄像头采集的第一帧;该终端设备获取该第二摄像头采集的第二帧,该第二帧与该第一帧对应;该终端设备将该第二帧融合到该第一帧,得到去模糊帧;该终端设备显示该去模糊帧的图像。
在上述实施例中,终端设备启动第一摄像头拍摄时,可以同时启动具备有OIS的第二摄像头,使用具备有OIS的第二摄像头采集的第二帧对第一摄像头采集的第一帧进行去模糊处理,可以使得终端设备对模糊帧的去模糊效果更好,从而使得终端设备显示的画面的清晰度一致性更高。
结合第一方面的一些实施例,在一些实施例中,该终端设备获取该第二摄像头采集的第二帧之前,该方法还包括:该终端设备确定该第一帧为模糊帧;该终端设备将该第二帧融合到该第一帧,得到去模糊帧之前,该方法还包括:该终端设备确定该第二帧为清晰帧。
在上述实施例中,使用清晰帧对模糊帧进行去模糊处理,是的终端设备的去模糊效果更好。
结合第一方面的一些实施例,在一些实施例中,该终端设备启动第二摄像头之前还包括:该终端设备确定该第一摄像头是否配备了OIS;若该第一摄像头未配备OIS,启动该第二摄 像头。
上述实施例中,终端设备可以实时判断启动的摄像头是否配备有OIS,只有启动的摄像头未配备有OIS时,才启动配备了OIS的第二摄像头,而不是只要有摄像头启动就启动另一个配备有OIS的摄像头,降低了终端设备的功耗。
结合第一方面的一些实施例,在一些实施例中,该终端设备将该第二帧融合到该第一帧,得到去模糊帧,具体包括:该终端设备确定将该第二帧转换到该第一帧的配准信息;该终端设备根据该配准信息,将该第二帧融合到该第一帧,得到该去模糊帧。
上述实施例中,终端设备根据配准信息将第二帧融合到第一帧,使得融合的更准确,从而得到的去模糊帧的去模糊效果更好。
结合第一方面的一些实施例,在一些实施例中,该终端设备确定将该第二帧转换到该第一帧的配准信息,具体包括:该终端设备根据对该第一帧和该第二帧下采样后提取的特征点,生成全局低精度配准信息;该终端设备根据对该第一帧和该第二帧裁切后提取的特征点,生成局部高精度配准信息;该终端设备使用该局部高精度配准信息校准该全局低精度配准信息,得到全局高精度配准信息,作为将该第二帧转换到该第一帧的配准信息。
在上述实施例中,在进行去模糊处理时,终端设备将第一帧和第二帧分别进行下采样后提取特征点匹配得到全局低精度配准信息,分别裁切后提取特征点匹配得到局部高精度配准信息,再使用该局部高精度配准信息校准该全局低精度配准信息的方式得到去模糊处理所需的全局高精度信息,极大的降低了进行图像配准所需的算力,使得该终端设备即使为移动终端设备,也可能实现实时的去模糊处理,使得移动终端设备拍摄出的图像的清晰度一致性更高。
结合第一方面的一些实施例,在一些实施例中,该终端设备根据对该第一帧和该第二帧下采样后提取的特征点,生成全局低精度配准信息,具体包括:该终端设备按照第一下采样比率对该第一帧下采样后提取特征点,得到第一特征点集合;该终端设备按照该第一下采样比率对该第二帧下采样后提取特征点,得到第二特征点集合;该终端设备根据该第一特征点集合和该第二特征点集合,生成将该第二帧变换到该第一帧的该全局低精度配准信息。
在上述实施例中,终端设备使用相同的下采样比率对第一帧和第二帧进行下采样,使得生成的图像的对应性较好,减少了生成全局低精度配准信息所需的算力。
结合第一方面的一些实施例,在一些实施例中,该终端设备根据对该第一帧和该第二帧裁切后提取的特征点,生成局部高精度配准信息,具体包括:该终端设备按照第一面积比值、第一中心点位置和第一形状对该第一帧裁切,得到第一裁切区域,对该第一裁切区域提取特征点,得到第三特征点集合;该第一面积比值为该第一裁切区域的面积与第一帧的总面积的比值,该第一形状为该第一裁切区域的形状;该第一中心点位置为该第一裁切区域的中心点相对于该第一帧的中心点的位置;该终端设备按照该第一面积比值、该第一中心点位置和该第一形状对该第二帧裁切,得到第二裁切区域,对该第二裁切区域提取特征点,得到第四特征点集合;该终端设备根据该第三特征点集合和该第四特征点集合,生成将该第二裁切区域变换到该第一裁切区域的该局部高精度配准信息。
在上述实施例中,终端设备使用相同裁切配置对第一帧和第二帧进行裁切,使得生成的 图像的对应性较好,减少了生成局部高精度配准信息所需的算力。
结合第一方面的一些实施例,在一些实施例中,该第一下采样比率为一个预设下采样比率;或该第一下采样比率为该终端设备根据实时运算能力确定的一个下采样比率。
结合第一方面的一些实施例,在一些实施例中,该第一面积比值为一个预设比值;或该第一面积比值为该终端设备根据实时运算能力确定的一个比值。
上述实施例中,第一下采样比率或第一面积比值可以由终端设备根据实时运算能力确定,使得终端设备算力较低时,也可以实时完成去模糊处理。
结合第一方面的一些实施例,在一些实施例中,该第一中心点位置为帧的中心点。
上述实施例中,将帧的中心点作为裁切的中心点,使得用户关注的中心区域的分辨率不丢失,去模糊的效果最好,提升了终端设备的人机交互性能。
结合第一方面的一些实施例,在一些实施例中,该第一形状为长方形或正方形。
上述实施例中,使用长方形或正方形作为裁切的形状,在进行特征提取和后续特征比对时使得特征点的矩阵更规则,降低了对配准信息校正得到全局高精度配准信息所需的算力。
结合第一方面的一些实施例,在一些实施例中,该终端设备获取该第二摄像头采集的第二帧,具体包括:该终端设备发送清晰帧选择标识给该第二摄像头,该清晰帧选择标识从包括该第一帧的时间信息和模糊程度信息;该终端设备接收该第二摄像头反馈的与该第一帧对应的该第二帧。
上述实施例中,让第二摄像头根据清晰帧选择标识反馈与模糊帧匹配的清晰帧,降低了终端设备中主处理器的算力需求。
结合第一方面的一些实施例,在一些实施例中,该第二帧为该第二摄像头采集的帧中与该第一帧的采集时间间隔在第一预设时长内,且模糊程度相比于该第一帧的模糊程度不超出预设模糊阈值的一个帧。
上述实施例中,限制第二帧与第一帧的采集时间间隔在第一预设时长内且模糊程度不超出预设模糊阈值,而不是使用第二摄像头采集的最清晰的一个帧,保障了将第二帧融合到第一帧时,帧画面不发生太多的跃变,保证了最终显示的帧画面的连续性,提升了终端设备拍摄出的图像清晰度的一致性。
第二方面,本申请提供了一种终端设备,该终端设备包括:第一启动模块,用于响应于用户的第一操作,启动第一摄像头;第二启动模块,用于在检测到该第一摄像头启动时,启动第二摄像头,其中该第二摄像头配备OIS光学防抖;第一获取模块,用于获取该第一摄像头采集的第一帧;第二获取模块,用于获取该第二摄像头采集的第二帧,该第二帧与该第一帧对应;融合模块,用于将该第二帧融合到该第一帧,得到去模糊帧;显示模块,用于显示该去模糊帧的图像。
结合第二方面的一些实施例,在一些实施例中,该终端设备还包括:第一确定模块,用于确定该第一帧为模糊帧;第二确定模块,用于确定该第二帧为清晰帧。结合第二方面的一些实施例,在一些实施例中,该终端设备还包括:第三确定模块,用于在该第一摄像头启动时,确定该第一摄像头是否配备了OIS;第三启动模块,用于当该第三确定模块确定第一摄像头未配备OIS时,启动该第二摄像头。
结合第二方面的一些实施例,在一些实施例中,该融合模块,具体包括:配准单元,用于确定将该第二帧转换到该第一帧的配准信息;融合单元,用于根据该配准信息,将该第二帧融合到该第一帧,得到该去模糊帧。
结合第二方面的一些实施例,在一些实施例中,该配准模块,具体包括:第一配准子单元,用于根据对该第一帧和该第二帧下采样后提取的特征点,生成全局低精度配准信息;第二配准子单元,用于根据对该第一帧和该第二帧裁切后提取的特征点,生成局部高精度配准信息;第三配准子单元,用于使用该局部高精度配准信息校准该全局低精度配准信息,得到全局高精度配准信息,作为将该第二帧转换到该第一帧的配准信息。
结合第二方面的一些实施例,在一些实施例中,该第一配准子单元,具体包括:第一特征子单元,用于按照第一下采样比率对该第一帧下采样后提取特征点,得到第一特征点集合;第二特征子单元,用于按照该第一下采样比率对该第二帧下采样后提取特征点,得到第二特征点集合;全局低精度配准子单元,用于根据该第一特征点集合和该第二特征点集合,生成将该第二帧变换到该第一帧的该全局低精度配准信息。
结合第二方面的一些实施例,在一些实施例中,该第二配准子单元,具体包括:第三特征子单元,用于按照第一面积比值、第一中心点位置和第一形状对该第一帧裁切,得到第一裁切区域,对该第一裁切区域提取特征点,得到第三特征点集合;该第一面积比值为该第一裁切区域的面积与第一帧的总面积的比值,该第一形状为该第一裁切区域的形状;该第一中心点位置为该第一裁切区域的中心点相对于该第一帧的中心点的位置;第四特征子单元,用于按照该第一面积比值、该第一中心点位置和该第一形状对该第二帧裁切,得到第二裁切区域,对该第二裁切区域提取特征点,得到第四特征点集合;局部高精度配准子单元,用于根据该第三特征点集合和该第四特征点集合,生成将该第二裁切区域变换到该第一裁切区域的该局部高精度配准信息。
结合第二方面的一些实施例,在一些实施例中,该第一下采样比率为一个预设下采样比率;或该第一下采样比率为该终端设备根据实时运算能力确定的一个下采样比率。
结合第二方面的一些实施例,在一些实施例中,该第一面积比值为一个预设比值;或该第一面积比值为该终端设备根据实时运算能力确定的一个比值。
结合第二方面的一些实施例,在一些实施例中,该第一中心点位置为帧的中心点。
结合第二方面的一些实施例,在一些实施例中,该第一形状为长方形或正方形。
结合第二方面的一些实施例,在一些实施例中,其特征在于,该第二获取模块,具体包括:标识发送单元,用于发送清晰帧选择标识给该第二摄像头,该清晰帧选择标识从包括该第一帧的时间信息和模糊程度信息;反馈接收单元,用于接收该第二摄像头反馈的与该第一帧对应的该第二帧。
结合第二方面的一些实施例,在一些实施例中,该第二帧为该第二摄像头采集的帧中与该第一帧的采集时间间隔在第一预设时长内,且模糊程度相比于该第一帧的模糊程度不超出预设模糊阈值的一个帧。
第三方面,本申请提供了一种终端设备,该终端设备包括:一个或多个处理器、存储器、第一摄像头、第二摄像头和显示屏;该存储器与该一个或多个处理器耦合,该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令,该一个或多个处理器调用该计算机指令以使得该终端设备执行:响应于用户的第一操作,启动第一摄像头;在检测到该第一摄像头启动时,启动第二摄像头,其中该第二摄像头配备OIS;获取该第一摄像头采集的第一 帧;获取该第二摄像头采集的第二帧,该第二帧与该第一帧对应;将该第二帧融合到该第一帧,得到去模糊帧;显示该去模糊帧的图像。
结合第三方面的一些实施例,在一些实施例中,该一个或多个处理器,还用于调用该计算机指令以使得该终端设备执行:确定该第一帧为模糊帧;确定该第二帧为清晰帧。
结合第三方面的一些实施例,在一些实施例中,该一个或多个处理器,还用于调用该计算机指令以使得该终端设备执行:确定该第一摄像头是否配备了OIS;若该第一摄像头未配备OIS,启动该第二摄像头。
结合第三方面的一些实施例,在一些实施例中,该一个或多个处理器,具体用于调用该计算机指令以使得该终端设备执行:确定将该第二帧转换到该第一帧的配准信息;根据该配准信息,将该第二帧融合到该第一帧,得到该去模糊帧。
结合第三方面的一些实施例,在一些实施例中,该一个或多个处理器,具体用于调用该计算机指令以使得该终端设备执行:根据对该第一帧和该第二帧下采样后提取的特征点,生成全局低精度配准信息;根据对该第一帧和该第二帧裁切后提取的特征点,生成局部高精度配准信息;使用该局部高精度配准信息校准该全局低精度配准信息,得到全局高精度配准信息,作为将该第二帧转换到该第一帧的配准信息。
结合第三方面的一些实施例,在一些实施例中,该一个或多个处理器,具体用于调用该计算机指令以使得该终端设备执行:按照第一下采样比率对该第一帧下采样后提取特征点,得到第一特征点集合;按照该第一下采样比率对该第二帧下采样后提取特征点,得到第二特征点集合;根据该第一特征点集合和该第二特征点集合,生成将该第二帧变换到该第一帧的该全局低精度配准信息。
结合第三方面的一些实施例,在一些实施例中,该一个或多个处理器,具体用于调用该计算机指令以使得该终端设备执行:按照第一面积比值、第一中心点位置和第一形状对该第一帧裁切,得到第一裁切区域,对该第一裁切区域提取特征点,得到第三特征点集合;该第一面积比值为该第一裁切区域的面积与第一帧的总面积的比值,该第一形状为该第一裁切区域的形状;该第一中心点位置为该第一裁切区域的中心点相对于该第一帧的中心点的位置;按照该第一面积比值、该第一中心点位置和该第一形状对该第二帧裁切,得到第二裁切区域,对该第二裁切区域提取特征点,得到第四特征点集合;根据该第三特征点集合和该第四特征点集合,生成将该第二裁切区域变换到该第一裁切区域的该局部高精度配准信息。
结合第三方面的一些实施例,在一些实施例中,该第一下采样比率为一个预设下采样比率;或该第一下采样比率为该终端设备根据实时运算能力确定的一个下采样比率。
结合第三方面的一些实施例,在一些实施例中,该第一面积比值为一个预设比值;或该第一面积比值为该终端设备根据实时运算能力确定的一个比值。
结合第三方面的一些实施例,在一些实施例中,该第一中心点位置为帧的中心点。
结合第三方面的一些实施例,在一些实施例中,该第一形状为长方形或正方形。
结合第三方面的一些实施例,在一些实施例中,该一个或多个处理器,具体用于调用该计算机指令以使得该终端设备执行:发送清晰帧选择标识给该第二摄像头,该清晰帧选择标识从包括该第一帧的时间信息和模糊程度信息;接收该第二摄像头反馈的与该第一帧对应的该第二帧。
结合第三方面的一些实施例,在一些实施例中,该第二帧为该第二摄像头采集的帧中与该第一帧的采集时间间隔在第一预设时长内,且模糊程度相比于该第一帧的模糊程度不超出预设模糊阈值的一个帧。
第四方面,本申请实施例提供了一种芯片系统,该芯片系统应用于终端设备,该芯片系统包括一个或多个处理器,该处理器用于调用计算机指令以使得该终端设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。
第五方面,本申请实施例提供一种包含指令的计算机程序产品,当上述计算机程序产品在终端设备上运行时,使得上述终端设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。
第六方面,本申请实施例提供一种计算机可读存储介质,包括指令,当上述指令在终端设备上运行时,使得上述终端设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。
可以理解地,上述第二方面提供的终端设备、第三方面提供的终端设备、第四方面提供的芯片系统、第五方面提供的计算机程序产品和第六方面提供的计算机存储介质均用于执行本申请实施例所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。
附图说明
图1是一个进行图像处理的信息流示意图;
图2是本申请实施例中一种图像处理方法的信息流示意图;
图3是本申请实施例中不同清晰度的清晰帧与模糊帧融合后去模糊效果的一个示例性比对示意图;
图4是本申请实施例中配备有OIS的摄像头与没有配备OIS的摄像头采集的图像的一个示例性比对示意图;
图5是本申请实施例中一个进行图像处理的信息流示意图;
图6是本申请实施例中另一个进行图像处理的信息流示意图;
图7是本申请实施例中终端设备100的硬件结构示例性示意图;
图8是本申请实施例中图像处理方法的一个流程示意图;
图9是本申请实施例中对一个帧进行下采样并提取特征点的示例性示意图;
图10是本申请实施例中生成低精度配准信息的一个示例性场景示意图;
图11是本申请实施例中对一个帧进行裁切并提取特征点的示例性场景示意图;
图12是本申请实施例中生成局部高精度配准信息的一个示例性场景示意图;
图13是本申请实施例中将清晰帧Q1融合到模糊帧M1的一个示例性场景示意图;
图14是本申请实施例中图像处理方法的另一个流程示意图;
图15是本申请实施例中图像处理方法的另一个流程示意图;
图16是本申请实施例中图像处理方法的另一个流程示意图。
具体实施方式
本申请以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括复数表达形式,除非其上下文中明确地有相反指示。还应当理解,本申请中使用的术语“和/或”是指并包含一个或多个所 列出项目的任何或所有可能组合。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
本申请实施例提供了一种图像处理方法,用于提升终端设备拍摄出的图像的清晰度。
在一种实现方式中,如图1所示,可以通过输入一个视频序列,先进入模糊帧检测模块,判断哪些帧是模糊的,哪些帧是清晰的;在确定当前帧为模糊帧时,利用该模糊帧生成模糊核;选择一个与该模糊帧匹配最佳的清晰帧,将该模糊核应用于该清晰帧上,生成新的模糊帧;将新的模糊帧与原来的模糊帧进行块匹配,计算出配准信息;最后根据配准信息,将新的模糊帧与原来的模糊帧进行融合,从而得到去模糊帧。重复多次这样的步骤,可以得到最终的去模糊视频。
然而采用该实现方式,一方面其效果受限于当前视频序列中清晰帧的清晰程度;另一方面其在配准时,采用了先将清晰帧变模糊,再进行块匹配的操作,其操作计算复杂度极高,需要多次迭代求解,以当前移动终端设备的算力,无法支撑其在对高清图(例如4K、1080P分辨率的图像)进行处理时实时运行。
而在本申请实施例中提供的一种图像处理方法中,如图2所示,在开启的摄像头没有配备OIS时,会同时开启另外配备了OIS的摄像头开始拍摄,并同时对两个摄像头输出的视频帧进行模糊帧检测;然后选择与当前模糊帧最匹配的清晰帧送入配准模块进行配准,再将该清晰帧与模糊帧融合,得到去模糊帧,使得模糊帧替换为更清晰的去模糊帧,提升了终端设备拍摄出的图像的清晰度一致性。
可以理解的是,本申请实施例中的拍摄可以是拍照,也可以是摄影,此处不作限定。
如图3所示,为使用不同清晰度的清晰帧与模糊帧融合后,得到的去模糊帧的去模糊效果的一个示例性比对示意图。可见,与模糊帧融合的清晰帧越清晰,对模糊帧的去模糊效果就越好。
如图4所示,为配备OIS的摄像头与没有配备OIS的摄像头采集的图像的一个示例性比对示意图。可见,配备了OIS的摄像头相比没有配备OIS的摄像头采集的图像更清晰。
而在本申请提供的该种图像处理方法中,终端设备并不仅从一个未配备OIS的摄像头自己拍摄的视频序列中去寻找清晰帧,而是在该摄像头启动时,同时启动另一个带OIS的摄像头。可以从该带OIS的摄像头拍摄的帧中去寻找与模糊帧匹配的清晰帧。由于配备了OIS的摄像头能够获取到更多的清晰帧,因此可以使得采用该图像处理方法后,对模糊帧的去模糊效果更好,使得终端设备拍摄出的图像的清晰度一致性更高。
在本申请实施例中提供的另一种图像处理方法中,如图5所示,在需要将清晰帧A与模糊帧B进行融合时,终端设备一方面可以将该清晰帧A与模糊帧B下采样,得到全局的低精度配准信息;另一方面可以裁剪该清晰帧A与模糊帧B相应的特定区域,得到局部高精度配准信息;然后使用该局部的高精度配准信息提升该全局的低精度配准信息的精度,得到全局的高精度配准信息;最后使用该全局的高精度配准信息融合该清晰帧A与模糊帧B,得到去模糊帧,使得模糊帧替换为更清晰的去模糊帧,提升了终端设备拍摄出的图像的清晰度一致性。
可以理解的是,将清晰帧与模糊帧下采样后得到全局低精度配准信息,极大的降低了获取全局配准信息所需的计算量,在该终端设备为移动终端设备时,使得移动终端设备可以实时进行相关计算。相应的,仅计算清晰帧与模糊帧裁剪后的一小部分的局部高精度配准信息,同样极大的降低了获取清晰帧与模糊帧中画面间高精度配准信息所需的计算量,使得移动终端设备可以实时进行相关计算。因此,采用该图像处理方法后,极大了降低了移动终端进行清晰帧与模糊帧融合所需要的计算量,移动终端可以实时进行相关处理,使得终端设备拍摄出的图像的清晰度一致性更高。
可以理解的是,本申请实施例中提供的上述图像处理方法也可以组合使用,如图6所示,在开启的摄像头没有配备OIS时,终端设备可以同时开启另外配备了OIS的摄像头开始拍摄,并同时对两个摄像头输入的视频帧进行模糊帧检测。在没有配备OIS的摄像头拍摄的为模糊帧时,可以选择一帧配备了OIS的摄像头拍摄的与该模糊帧最匹配的清晰帧,一方面进行下采样后配准得到全局低精度配准信息,另一方面裁切后配准得到局部高精度配准信息。再采用该局部高精度配准信息对该全局低精度配准信息校正,得到全局高精度配准信息。使用该全局高精度配准信息将该清晰帧融合到该模糊帧中,得到去模糊帧,使得模糊帧替换为更清晰的去模糊帧,提升了终端设备拍摄出的图像的清晰度一致性。
这样,不仅可以使得终端设备拍摄出的图像的清晰度一致性更高,而且由于极大了降低了清晰帧与模糊帧配准融合时所需的计算量,因此即使该终端设备是算力较低的移动终端设备,也可以实时进行相关计算,从而实时提升拍摄出的图像的清晰度一致性。
下面介绍本申请实施例提供的示例性终端设备100。
图7是本申请实施例提供的终端设备100的结构示意图。
下面以终端设备100为例对实施例进行具体说明。应该理解的是,终端设备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接口等。
SIM接口可以被用于与SIM卡接口195通信,实现传送数据到SIM卡或读取SIM卡中数据的功能。
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等供电。
终端设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。终端设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在终端设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块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)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其 进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,终端设备100的天线l和移动通信模块150耦合,天线2和无线通信模块160耦合,使得终端设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
终端设备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的正整数。
本申请实施例中,该1个或N个摄像头193中可以包含有配备了OIS的摄像头,以及没有配备OIS的摄像头,此处不作限定。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。终端设备100可以支持一种或多种视频编解码器。这样,终端设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
内部存储器121可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。
随机存取存储器可以包括静态随机存储器(static random-access memory,SRAM)、动态随机存储器(dynamic random access memory,DRAM)、同步动态随机存储器(synchronous dynamic random access memory,SDRAM)、双倍资料率同步动态随机存取存储器(double data rate synchronous dynamic random access memory,DDR SDRAM,例如第五代DDR SDRAM一般称为DDR5 SDRAM)等;
非易失性存储器可以包括磁盘存储器件、快闪存储器(flash memory)。
快闪存储器按照运作原理划分可以包括NOR FLASH、NAND FLASH、3D NAND FLASH等,按照存储单元电位阶数划分可以包括单阶存储单元(single-level cell,SLC)、多阶存储单元(multi-level cell,MLC)、三阶储存单元(triple-level cell,TLC)、四阶储存单元(quad-level cell,QLC)等,按照存储规范划分可以包括通用闪存存储(英文:universal flash storage,UFS)、嵌入式多媒体存储卡(embedded multi media Card,eMMC)等。
随机存取存储器可以由处理器110直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用程序的数据等。
非易失性存储器也可以存储可执行程序和存储用户及应用程序的数据等,可以提前加载到随机存取存储器中,用于处理器110直接进行读写。
外部存储器接口120可以用于连接外部的非易失性存储器,实现扩展终端设备100的存储能力。外部的非易失性存储器通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部的非易失性存储器中。
终端设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。终端设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当终端设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。终端设备100可以设置至少一个麦克风170C。在另一些实施例中,终端设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,终端设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动终端设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工 业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。终端设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,终端设备100根据压力传感器180A检测所述触摸操作强度。终端设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定终端设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定终端设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测终端设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消终端设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,终端设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。终端设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当终端设备100是翻盖机时,终端设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测终端设备100在各个方向上(一般为三轴)加速度的大小。当终端设备100静止时可检测出重力的大小及方向。还可以用于识别终端设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。终端设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,终端设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。终端设备100通过发光二极管向外发射红外光。终端设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定终端设备100附近有物体。当检测到不充分的反射光时,终端设备100可以确定终端设备100附近没有物体。终端设备100可以利用接近光传感器180G检测用户手持终端设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。终端设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测终端设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。终端设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,终端设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,终端设备 100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,终端设备100对电池142加热,以避免低温导致终端设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,终端设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于终端设备100的表面,与显示屏194所处的位置不同。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。终端设备100可以接收按键输入,产生与终端设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和终端设备100的接触和分离。终端设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。终端设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。
本申请实施例中,该处理器110可以根据摄像头194获取到的图像,调用内部存储器121中存储的操作指令,执行本申请实施例中的图像处理方法,提升终端设备拍摄出的图像的清晰度,并发送到显示屏194进行显示。
下面结合述示例性终端设备100的硬件结构,对本申请实施例涉及的一些应用场景进行描述:
示例性的,在一个应用场景中,终端设备A具有1个前置摄像头和2个后置摄像头。2个后置摄像头分别为:采集画面清晰度较高且配备有OIS的主摄像头、视角广而焦距短的广角镜头。若用户需要拍摄清晰度较高的照片或视频,可以开启主摄像头进行拍摄;若用户需要拍摄画面范围更广的照片或视频,可以开启广角摄像头进行拍摄。
其中主摄像头和广角摄像头会根据用户的选择单独使用。终端设备A默认拍摄时启动广角摄像头进行拍摄,得到画面范围较广的照片或视频。若用户需要拍摄更高清的照片或视频,需要调整拍摄模式为高清拍摄模式,此时终端设备A会关闭广角摄像头,切换启动主摄像头进行拍摄,此时拍摄出的照片或视频分辨率更高,但画面范围更小。
而采用了本申请实施例中的图像处理方法后,终端设备A默认启动广角摄像头进行拍摄时,会同时启动该主摄像头,并可以在显示屏上显示文本提示框提示用户:“将同时使用主摄 像头提升广角摄像头拍摄画面的清晰度”。终端设备A会在广角摄像头工作时,启动主摄像头工作,使用主摄像头采集的清晰度更高的帧对广角摄像头采集的模糊帧进行去模糊处理,从而使得最终拍摄得到的画面更清晰且画面范围广。
示例性的,在另一个应用场景中,终端设备A具有1个前置摄像头和3个后置摄像头。3个后置摄像头分别为:采集画面清晰度较高且配备有OIS的主摄像头、视角广而焦距短的广角镜头、视角小而焦距长的长焦摄像头。若用户需要拍摄清晰度较高的照片或视频,可以开启主摄像头进行拍摄;若用户需要拍摄画面范围更广的照片或视频,可以开启广角摄像头进行拍摄;若用户需要拍摄距离更远的景物,可以开启长焦摄像头进行拍摄。
其中主摄像头、广角摄像头和长焦摄像头均会根据用户的选择单独使用。终端设备A默认拍摄时启动广角摄像头进行拍摄,得到画面范围较广的照片或视频。若用户需要拍摄更高清的照片或视频,需要调整拍摄模式为高清拍摄模式,此时终端设备A会关闭广角摄像头,切换启动主摄像头进行拍摄,此时拍摄出的照片或视频分辨率更高,但画面范围更小。若用户需要拍摄距离更远的景物,需要调整为远距拍摄模式,此时终端设备A会关闭其他摄像头,切换启动长焦摄像头进行拍摄,此时能拍摄到距离更远的景物,但是拍摄出的照片或视频视角小且分辨率低。
而采用了本申请实施例中的图像处理方法后,终端设备A默认启动广角摄像头进行拍摄时,会同时启动该主摄像头,并可以在显示屏上显示文本提示框提示用户:“将同时使用主摄像头提升广角摄像头拍摄画面的清晰度”。终端设备A会在广角摄像头工作时,启动主摄像头工作,使用主摄像头采集的清晰度更高的帧对广角摄像头采集的模糊帧进行去模糊处理,从而使得最终拍摄得到的画面更清晰且画面范围广。
若用户希望拍摄远处的景物,调整拍摄模式为远距拍摄模式,终端设备A启动长焦摄像头时,可以同时启动主摄像头,并可以在显示屏上显示文本提示框提示用户:“将同时使用主摄像头提升长焦摄像头拍摄画面的清晰度”。终端设备A会在广角摄像头工作时,启动主摄像头工作,使用主摄像头采集的清晰度更高的帧对长焦摄像头采集的模糊帧进行去模糊处理,从而不仅能拍摄到更远处的景物而且画面很清晰。
示例性的,在另一个应用场景中,终端设备A具有1个前置摄像头和4个后置摄像头。4个后置摄像头分别为:采集画面清晰度较高且配备有OIS的主摄像头、视角广而焦距短的广角镜头、视角小而焦距长且配备有OIS的长焦摄像头1、焦距更长的长焦摄像头2。若用户需要拍摄清晰度较高的照片或视频,可以开启主摄像头进行拍摄;若用户需要拍摄画面范围更广的照片或视频,可以开启广角摄像头进行拍摄;若用户需要拍摄距离更远的景物,可以开启长焦摄像头1进行拍摄;若用户需要拍摄距离更远的景物,可以开启长焦摄像头2进行拍摄。
其中主摄像头、广角摄像头、长焦摄像头1和长焦摄像头2均会根据用户的选择单独使用。终端设备A默认拍摄时启动广角摄像头进行拍摄,得到画面范围较广的照片或视频。若用户需要拍摄更高清的照片或视频,需要调整拍摄模式为高清拍摄模式,此时终端设备A会关闭广角摄像头,切换启动主摄像头进行拍摄,此时拍摄出的照片或视频分辨率更高,但画面范围更小。若用户需要拍摄距离较远的景物,需要调整为远距拍摄模式,此时终端设备A会关闭其他摄像头,切换启动长焦摄像头1进行拍摄,此时能拍摄到距离较远的景物;若用户需要拍摄距离更远的景物,需要调整为超远距拍摄模式,此时终端设备A会关闭其他摄像 头,切换启动长焦摄像头2进行拍摄,此时能拍摄到距离更远的景物,但是拍摄出的照片或视频视角小且分辨率低。
而采用了本申请实施例中的图像处理方法后,终端设备A默认启动广角摄像头进行拍摄时,会同时启动该主摄像头,并可以在显示屏上显示文本提示框提示用户:“将同时使用主摄像头提升广角摄像头拍摄画面的清晰度”。终端设备A会在广角摄像头工作时,启动主摄像头工作,使用主摄像头采集的清晰度更高的帧对广角摄像头采集的模糊帧进行去模糊处理,从而使得最终拍摄得到的画面更清晰且画面范围广。
若用户希望拍摄非常远的景物,调整拍摄模式为超远距拍摄模式,终端设备A启动长焦摄像头2时,可以同时启动长焦摄像头1,并可以在显示屏上显示文本提示框提示用户:“将同时使用长焦摄像头1提升长焦摄像头2拍摄画面的清晰度”。终端设备A会在长焦摄像头1工作时,启动长焦摄像头2工作,使用长焦摄像头1采集的清晰度更高的帧对长焦摄像头2采集的模糊帧进行去模糊处理,从而不仅能拍摄到更远处的景物而且画面很清晰。
示例性的,在另一个应用场景中,终端设备A具有1个前置摄像头和3个后置摄像头。3个后置摄像头分别为:采集画面清晰度较高的主摄像头、视角广而焦距短的广角镜头、配备有OIS的防抖摄像头。若用户需要拍摄清晰度较高的照片或视频,可以开启主摄像头进行拍摄;若用户需要拍摄画面范围更广的照片或视频,可以开启广角摄像头进行拍摄;若用户需要运动中拍摄景物,可以开启防抖摄像头进行拍摄。
其中主摄像头、广角摄像头、防抖摄像头均会根据用户的选择单独使用。终端设备A默认拍摄时启动广角摄像头进行拍摄,得到画面范围较广的照片或视频。若用户需要拍摄更高清的照片或视频,需要调整拍摄模式为高清拍摄模式,此时终端设备A会关闭广角摄像头,切换启动主摄像头进行拍摄,此时拍摄出的照片或视频分辨率更高,但画面范围更小。若用户需要在运动中拍摄,需要调整为防抖模式,此时终端设备A会关闭其他摄像头,切换启动防抖摄像头进行拍摄,可以在运动中拍摄时也保持画面稳定。
而采用了本申请实施例中的图像处理方法后,终端设备A默认启动广角摄像头进行拍摄时,会同时启动该防抖摄像头,并可以在显示屏上显示文本提示框提示用户:“将同时使用防抖摄像头提升广角摄像头拍摄画面的清晰度”。终端设备A会在广角摄像头工作时,启动防抖摄像头工作,使用防抖摄像头采集的清晰度稳定的帧对广角摄像头采集的模糊帧进行去模糊处理,从而使得最终拍摄得到的画面更清晰且稳定。
若用户希望拍摄更清晰的画面,调整拍摄模式为高清拍摄模式后,终端设备A会在启动主摄像头进行拍摄时,同时启动防抖摄像头,并可以在显示屏上显示文本提示框提示用户:“将同时使用防抖摄像头提升主摄像头拍摄画面的稳定性”。终端设备A会在主摄像头工作时,启动防抖摄像头工作,使用防抖摄像头采集的清晰度稳定的帧对主摄像头采集的模糊帧进行去模糊处理,从而使得最终拍摄得到的画面更清晰且稳定。
可以理解的是,除上述几种示例性的应用场景外,在其他一些应用场景中,终端设备还可以有更多或更少的摄像头,这些摄像头还可以具备有其他各种不同的功能,此处不作限定。
下面结合上述示例性终端设备100的硬件结构以及一些具体应用场景,对本申请实施例中的图像处理方法进行具体描述:
应用场景1:终端设备中包括没有配备OIS的具有广角镜头的摄像头A和配备了OIS的具有防抖功能的摄像头B,用户启动该摄像头A进行拍摄。
请参阅图8,为本申请实施例中图像处理方法的一个流程示意图:
S801、响应于用户启动拍摄的操作A,终端设备开启未配备OIS的摄像头A;
可以理解的是,该操作A可以是点击照片拍摄控件,也可以是点击录像控件,也可以为其他能触发启动拍摄的组合操作等,此处不作限定;该照片拍摄控件或录像控件可以为终端设备出厂预设的软件中的控件,也可以为第三方软件中的控件,此处不作限定。
示例性的,用户想拍摄外部景色,因此可以打开录像软件,点击开始录制作为操作A,触发中断设备开启未配备OIS的具有广角镜头的摄像头A对身边景色进行拍摄。
S802、终端设备实时缓存摄像头A拍摄的5帧视频序列,记为X1;
终端设备开启摄像头A后,摄像头A可以拍摄视频帧,得到视频序列。终端设备可以实时缓存该摄像头A拍摄的视频序列。
本申请实施例中以终端设备缓存摄像头A拍摄的5帧视频序列为例,将该实时缓存的5帧视频序列记为X1。可以理解的是,在实际应用中,终端设备可以实时缓存摄像头A拍摄的更多或更少帧的视频序列,此处不作限定。
需要说明的是,终端设备在录像或拍照时都可以缓存多个帧作为视频序列。区别在于,若为拍照,则终端设备最终可以从视频序列中选择一个最优的帧作为照片。
S803、在检测到摄像头A启动时,终端设备启动配备了OIS的摄像头B;
本申请实施例中,在检测到未配备OIS的摄像头A启动时,终端设备会启动配备了OIS的摄像头B。
具体的,本申请的一些实施例中,终端设备先可以判断启动的摄像头是否配备有OIS,当确定启动的该摄像头A未配备有OIS时,该终端设备才去启动配备了OIS的摄像头B。
可以理解的是,在拍摄环境相对恶劣的场景下,例如黑暗环境、抖动场景等,配备了OIS的摄像头B可以拍摄得到比没有配备OIS的摄像头A更清晰的帧画面。
另一方面,虽然摄像头A拍摄得到的帧画面可能没有摄像头B拍摄得到的帧画面清晰,但由于摄像头A具有广角镜头,因此该摄像头A拍摄得到的帧画面涵盖的景物范围可能更广、空间纵深感可能更强。因此两个摄像头具有不相同的功能和作用来满足用户需求,而不会用一个摄像头拍摄的帧画面来完全取代另一个摄像头拍摄的帧画面。
本申请的一些实施例中,该摄像头A也可以被称为第一摄像头,该摄像头B也可以被称为第二摄像头,此处不作限定。
S804、终端设备实时缓存摄像头B拍摄的5帧视频序列,记为X2;
终端设备开启摄像头B后,摄像头B可以拍摄视频帧,得到视频序列。终端设备可以实时缓存该摄像头B拍摄的视频序列。
本申请实施例中以终端设备缓存摄像头B拍摄的5帧视频序列为例,将该实时缓存的5帧视频序列记为X2。可以理解的是,在实际应用中,终端设备可以实时缓存摄像头B拍摄的更多或更少帧的视频序列,此处不作限定。
S805、将X1最中间的帧作为当前帧D1,终端设备确定该当前帧D1是否为清晰帧;
终端设备启动摄像头拍摄画面,缓存拍摄得到的帧画面得到视频序列后,会将视频序列中的帧画面按照一定的时间顺序进行显示。
例如对于摄像头A拍摄得到的5帧视频序列X1,终端设备可以按照拍摄时间由早到晚的顺序,依次显示X1中的这5个帧画面。若将当前待显示的帧称为当前帧D1,假设此时X1最中间的帧为当前帧D1,终端设备可以先确定该当前帧D1是否为清晰帧。
需要说明的是,确定一个帧为模糊帧还是清晰帧可以使用现有技术中的相关方法,例如判断连续像素点间色阶的变化曲线、判断锐化程度等等,此处不作赘述。
对于模糊帧和清晰帧的具体的根据预设条件的判断方式可以有很多种,例如:
在一些实施例中,若第一预设条件为终端设备中设置的一个帧为模糊帧的条件,在该当前帧符合该第一预设条件时,终端设备可以确定该当前帧D1为模糊帧;若该当前帧不符合该第一预设条件时,终端设备可以确定该当前帧D1为清晰帧。
在另一些实施例中,若第二预设条件为终端设备中设置的一个帧为清晰帧的条件,在该当前帧符合该第二预设条件时,终端设备可以确定该当前帧D1为清晰帧;若该当前帧不符合该第二预设条件时,终端设备可以确定该当前帧D1为模糊帧;
在另一些实施例中,若第三预设条件为终端设备中设置的一个帧为模糊帧的条件,第四预设条件为终端设备中设置的一个帧为清晰帧的条件,在该当前帧符合第三预设条件时,终端设备可以确定当前帧D1模糊帧;若该当前帧符合该第四预设条件时,终端设备可以确定该当前帧D1为清晰帧。
可以理解的是,还可以有更多各种条件相互组合来判断一个帧是模糊帧还是清晰帧的方式,此处不作限定。
本申请实施例中,在终端设备确定当前帧D1是清晰帧时,可以执行步骤S816;在确定当前帧D1不是清晰帧时,可以执行步骤S806。
在一些实施例中,若终端设备直接判断当前帧D1为模糊帧,则可以不再执行步骤S806,而直接执行步骤S806的后续步骤,此处不作限定。
S806、终端设备确定当前帧D1为模糊帧,记为模糊帧M1;
若第一预设条件为终端设备中设置的一个帧为模糊帧的条件,在该当前帧D1符合该第一预设条件时,终端设备可以确定该当前帧D1为模糊帧,在本申请实施例中可记为模糊帧M1。
本申请实施例中,在确定一个帧为模糊帧后,可以执行后续步骤S807、S808、S810。可以理解的是,终端设备可以根据运算能力和执行速度等,同步执行这几个步骤,也可以按照一定的顺序依次执行这几个步骤,或是在执行过程中实时动态调整这几个步骤的执行顺序等,此处不作限定。
S807、终端设备从X2中选择与该模糊帧M1匹配的清晰帧Q1;
在终端设备确定当前帧D1为模糊帧M1后,可以从摄像头B拍摄并缓存是视频序列X2中选择一个与该模糊帧M1匹配且清晰的清晰帧Q1。
在一些实施例中,终端设备在确定当前帧D1为模糊帧M1后,可以发送清晰帧选择标识给摄像头B,由摄像头B中确定一个匹配且清晰的清晰帧Q1。该清晰帧选择标识中可以携带有该模糊帧M1的时间信息和模糊程度信息等。
在一些实施例中,确定出的清晰帧Q1可以为该视频序列X2中清晰度与该模糊帧M1相比不超出模糊程度阈值、且采集时间与该模糊帧M1的采集时间最接近的帧或采集时间与该模糊帧M1的采集时间在第一预设时长内的一个帧。
具体选择视频序列X2中哪一个帧作为与该模糊帧M1匹配的清晰帧Q1的规则,可以根据实际需求来确定,也可以参考现有技术中从一个视频序列中选择一个与目标帧匹配的清晰帧的相关规则,此处不作限定。
S808、终端设备对该模糊帧M1进行下采样,并提取特征点T1;
可以理解的是,下采样,又称缩小图像,即降低图像分辨率,能显著降低对图像进行相关计算需要的算力。例如,若一副图像I尺寸为M*N,对其进行s倍比率的下采样,即得到(M/s)*(N/s)尺寸的分辨率图像,其中s一般为M和N的公约数。对于矩阵形式的图像,相当于将原始图像s*s窗口内的图像变成一个像素,这个像素点的值就是窗口内所有像素的均值。
在一些实施例中,特征点可以指图像灰度值发生剧烈变化的点或者在图像边缘上曲率较大的点(即两个边缘的交点)。图像特征点可以在基于特征点的图像匹配算法发挥作用。图像特征点能够反映图像本质特征,能够标识图像中目标物体。通过特征点的匹配能够完成图像的匹配。
本申请实施例中,终端设备对模糊帧M1进行下采样的第一下采样比率可以为预设下采样比率,也可以为根据终端设备当前的运算能力确定的下采样比率,此处不作限定。
可以理解的是,在对模糊帧M1完成下采样后,可以采用现有技术中相关特征点提取方法对下采样后图像提取特征点,得到特征点T1,此处不作赘述。
示例性的,如图9所示,为对一个帧进行下采样并提取特征点的示例性示意图。对尺寸为10*10模糊帧M1进行2倍下采样,可以得到5*5的画面,对该画面提取特征点,可以得到一个描述该图像的特征点的矩阵集合[T1]。
S809、终端设备对该清晰帧Q1进行下采样,并提取特征点T2;
与步骤S808中进行下采样并提取特征的方式类似,此处不再赘述。
可以理解的是,本申请实施例中,步骤S809采用与步骤S808中相同的第一下采样比率。
S810、终端设备根据特征点T1和特征点T2,生成全局低精度配准信息H1;
图像配准为将不同时间、不同传感器或不同天气条件下获取的两幅或多幅图像进行匹配、叠加的过程。配准过程一般可以采用如下方式:首先对两幅图像进行特征提取得到特征点;通过进行相似性度量找到匹配的特征点对;然后通过匹配的特征点对得到图像空间坐标变换参数;最后由坐标变换参数进行图像配准。
本申请实施例中,将从清晰帧变换到模糊帧的图像空间坐标变换参数的矩阵称为配准信息。
可以理解的是,生成低精度配准信息和生成高精度配准信息,在生成配准信息的方法上可以相同。只是因为对模糊帧M1和清晰帧Q1进行了下采样,提取到的特征点相对较少,因此,将生成得到的配准信息称为全局低精度的配准信息H1。
示例性的,如图10所示,为生成低精度配准信息的一个示例性场景示意图。对于将10*10的模糊帧M1下采样得到的5*5的画面,提取的特征点T1,和将8*8的清晰帧Q1下采样得到的4*4的画面,提取的特征点T2,进行相似性度量找到其中匹配的特征点对,然后通过匹配的特征点对即可计算得到从清晰帧Q1变换到模糊帧M1的该全局低精度的配准信息H1。
S811、终端设备对该模糊帧M1进行裁切,并提取特征点T3;
本申请实施例中,对帧进行裁切表示在不降低帧的分辨率(不损失清晰度)的情况下降低帧的画面大小。
具体的,在一些实施例中,终端设备可以按照第一面积比值、第一中心点位置和第一形状对该模糊帧M1进行裁切,模糊裁切区域,对该模糊裁切区域提取特征点,得到特征点T3。其中,该第一面积比值为模糊裁切区域的面积与模糊帧的总面积的比值,该第一形状为该模糊裁切区域的形状,该第一中心点位置为该模糊裁切区域的中心点相对于该模糊帧的中心点的位置。
在一些实施例中,会对帧的中心区域进行裁切,即该第一中心点位置为帧的中心点。可以理解的是,根据实际情况,也可以选择帧画面中其他位置进行裁切,此处不作限定。
在一些实施例中,该第一面积比值可以为一个预设比值,也可以为终端设备根据实时运算能力确定的一个比值,此处不作限定。
在一些实施例中,该第一形状可以为正方形或长方形。可以理解的是,根据实际情况,也可以裁切得到其他形状的画面,此处不作限定。
在一些实施例中,对于4K分辨率的帧画面,可以按照第一面积比值为1/4进行裁切,可以理解的是,根据实际情况,也可以裁切得到更大或更小的画面,此处不作限定。
示例性的,如图11所示,为对一个帧进行裁切并提取特征点的示例性场景示意图。对于将10*10的模糊帧M1,可以裁切其中心区域5*5的画面,对该画面提取特征点,可以得到一个描述该图像的特征点的矩阵集合[T3]。
S812、终端设备对该清晰帧Q1进行裁切,并提取特征点T4;
与步骤S811裁切并提取特征的方式类似,此处不再赘述。
具体的,在一些实施例中,终端设备可以按照第一面积比值、第一中心点位置和第一形状对该清晰帧Q1进行裁切,得到清晰裁切区域,对该清晰裁切区域提取特征点,得到特征点T4。其中,该第一面积比值为清晰裁切区域的面积与清晰帧的总面积的比值,该第一形状为该清晰裁切区域的形状,该第一中心点位置为该清晰裁切区域的中心点相对于该清晰帧的中心点的位置。
可以理解的是,本申请实施例中,步骤S812中的第一面积比值、第一中心点位置和第一形状与步骤S812中相同。
需要说明的是,本申请实施例中的上述特征点T1、特征点T2、特征点T3、特征点T4均可以为特征点集合。
S813、终端设备根据特征点T3和特征点T4,生成局部高精度配准信息h2;
根据该特征点T3和T4,终端设备可以生成将清晰帧Q1裁切得到的画面的图像空间变换到模糊帧M1裁切得到的画面的图像空间的配准信息h2。
示例性的,如图12所示,为生成局部高精度配准信息的一个示例性场景示意图。对于将10*10的模糊帧M1裁切中心区域得到的5*5的画面,提取的特征点T3,和将8*8的清晰帧Q1裁切中心区域得到的4*4的画面,提取的特征点T4,进行相似性度量找到其中匹配的特征点对,然后通过匹配的特征点对即可计算得到从清晰帧Q1裁切得到的画面变换到模糊帧M1裁切得到的画面的该局部高精度的配准信息h2。
S814、终端设备使用该局部高精度配准信息h2对全局低精度配准信息H1进行校正,得到全局高精度配准信息H3;
终端设备可以根据该局部高精度配准信息h2对全局低精度配准信息H1进行校正,提高该全局低精度配准信息的精度,从而得到全局高精度配准信息H3。
可以理解的是,使用h2对H1校准得到H3的具体方式可以有很多种,下面示例性的描述其中一种:
配准信息H1,h1,H3为整个画面中多块画面中每块画面的配准信息组成的矩阵。将H1中表示的第i块画面的配准信息记为Hi;将h2中表示的该第i块画面的配准信息记为hi;将Hi周围的第j块画面的配准信息记为Hj;将第i块配准信息的权重记为ωi;将空间一致性超参数记为λ;将H3记为
Figure PCTCN2022085763-appb-000001
采用如下公式1,通过使h i的值逼近H i,使H j的值逼近周边H i的值,从而可以得到该
Figure PCTCN2022085763-appb-000002
Figure PCTCN2022085763-appb-000003
S815、终端设备使用该全局高精度配准信息H3,将清晰帧Q1与模糊帧M1进行融合,得到去模糊帧F1;
得到全局高精度配准信息H3后,终端设备可以使用该H3,将清晰帧Q1融合到模糊帧M1中,得到去模糊帧F1。
示例性的,如图13所示,为清晰帧Q1融合到模糊帧M1的一个示例性场景示意图。根据该全局高精度配准信息H3,清晰帧Q1中的每个图像块都能变换到模糊帧M1中的相应位置,融合到模糊帧M1中,从而得到去模糊帧F1。
S816、终端设备显示该去模糊帧的图像或X1中的清晰帧的图像;
在步骤S805中终端设备确定X1中的当前帧为清晰帧时,或步骤S805中终端设备确定X1中的当前帧为模糊帧,经过后续将该模糊帧处理为去模糊帧后,终端设备都能显示该去模糊帧的图像或X1中的清晰帧的图像。
本申请实施例中,在拍摄启动的摄像头不具备OIS时,终端设备可以同时启动具备有OIS的摄像头,使用具备有OIS的摄像头拍摄的清晰帧对不具备OIS的模糊帧进行去模糊处理,可以使得终端设备对模糊帧的去模糊效果更好,从而使得终端设备显示的画面的清晰度一致性更高。并且,在进行去模糊处理时,终端设备将清晰帧和模糊帧分别进行下采样后提取特征点匹配得到全局低精度配准信息,分别裁切后提取特征点匹配得到局部高精度配准信息,再使用该局部高精度配准信息校准该全局低精度配准信息的方式得到将去模糊处理所需的全局高精度信息,极大的降低了进行图像配准所需的算力,使得该终端设备即使为移动终端设备,也可能实现进行实时的去模糊处理,使得移动终端设备拍摄出的图像的清晰度一致性更高。
下面以另一个应用场景为例,对本申请实施例中的图像处理方法进行具体描述:
应用场景2:终端设备中包含摄像头C,该摄像头C配置有OIS,或该摄像头C未配置OIS且该终端设备中不具备配置有OIS的摄像头。用户启动该摄像头C进行拍摄。
请参阅图14,为本申请实施例中图像处理方法的另一个流程示意图:
S1401、响应于用户启动拍摄的操作B,终端设备开启摄像头C;
本申请的一些实施例中,该摄像头C也可以被称为第二摄像头,此处不作限定。
S1402、终端设备实时缓存摄像头C拍摄的5帧视频序列,记为X3;
步骤S1401~S1402与步骤S801~S802类似,此处不再赘述。
S1403、将X3最中间的帧作为当前帧D1,终端设备判断该当前帧D1是否为清晰帧;
S1404、终端设备确定当前帧D1为模糊帧,记为模糊帧M1;
步骤S1403~S1404与步骤S805~S806类似,此处不再赘述。
S1405、终端设备从X3选择与该模糊帧M1匹配的清晰帧Q1;
在终端设备确定当前帧D1为模糊帧M1后,可以从摄像头C拍摄并缓存是视频序列X3中选择一个与该模糊帧M1匹配且清晰的帧Q1。
在一些实施例中,确定出的清晰帧Q1可以为该视频序列X3中清晰度与该模糊帧M1相比不超出模糊程度阈值、且时间与该模糊帧M1的采集时间最接近的帧。
在一些实施例中,确定出的清晰帧Q1可以为该视频序列X3中清晰度与该模糊帧M1相比不超出模糊程度阈值、且采集时间与该模糊帧M1的采集时间间隔在第一预设时长内的一个帧。
具体选择视频序列X3中哪一个帧作为与该模糊帧M1匹配的清晰帧Q1的规则,可以根据实际需求来确定,也可以参考现有技术中从一个视频序列中选择一个与目标帧匹配的清晰帧的相关规则,此处不作限定。
在一些实施例中,无论摄像头C是否配备了OIS,均可以按照步骤S1401~S1405的顺序执行。
S1406、终端设备对该模糊帧M1进行下采样,并提取特征点T1;
S1407、终端设备对该清晰帧Q1进行下采样,并提取特征点T2;
S1408、终端设备根据特征点T1和特征点T2,生成全局低精度配准信息H1;
S1409、终端设备对该模糊帧M1进行裁切,并提取特征点T3;
S1410、终端设备对该清晰帧Q1进行裁切,并提取特征点T4;
S1411、终端设备根据特征点T3和特征点T4,生成局部高精度配准信息h2;
S1412、终端设备使用该局部高精度配准信息h2对全局低精度配准信息H1进行校正,得到全局高精度配准信息H3;
S1413、终端设备使用该全局高精度配准信息H3,将清晰帧Q1与模糊帧M1进行融合,得到去模糊帧F1;
S1414、终端设备显示该去模糊帧的图像或X3中的清晰帧的图像;
步骤S1406~S1414与步骤S808~S816类似,可参与对步骤S808~S816的描述,此处不再赘述。
本申请实施例中,终端设备可以根据通过一个摄像头拍摄的视频序列中的帧画面,对其中的模糊帧进行去模糊处理,从而使得终端设备显示的画面的清晰度一致性更高。并且,在进行去模糊处理时,终端设备将清晰帧和模糊帧分别进行下采样后提取特征点匹配得到全局低精度配准信息,分别裁切后提取特征点匹配得到局部高精度配准信息,再使用该局部高精度配准信息校准该全局低精度配准信息的方式得到将去模糊处理所需的全局高精度信息,极大的降低了进行图像配准所需的算力,使得该终端设备即使为移动终端设备,也可能实现进行实时的去模糊处理,使得移动终端设备拍摄出的图像的清晰度一致性更高。
在本申请的一些实施例中,图8和图14所示的实施例中的图像处理方法也可以结合使用。例如,终端设备可以判断启动的摄像头是否配备有OIS;当确定启动的摄像头配备有OIS时,例如启动的是摄像头A,终端设备可以按照图8所示的实施例执行该图像处理方法:当确定启动的摄像头A未配备有OIS时,启动配备了OIS的摄像头B;当确定启动的摄像头没有配备OIS时,例如启动的是没有配备OIS的摄像头C,终端设备可以按照图14所示的实施例执行该图像处理方法:当确定启动的摄像头C未配备有OIS、且该摄像头C采集的一个帧为模糊帧时,从该摄像头C采集的帧中确定与该模糊帧匹配且清晰的一个清晰帧。可以理解的是,还可以有其他的将图8和图14所示的实施例中的图像处理方法相结合的方式,此处不作限定。
结合图8与图14所示的实施例,如图15所示,本申请实施例还提供了另一种图像处理方法:
S1501、响应于用户启动拍摄的操作A,终端设备启动摄像头A;
S1502、在检测到摄像头A启动时,终端设备启动摄像头B,该摄像头B配备OIS;
本申请的一些实施例中,在检测到摄像头A启动时,终端设备可以直接启动摄像头B。
本申请的一些实施例中,在检测到摄像头A启动后,终端设备可以确定该摄像头A是否配备了OIS;若配备了OIS,则启动摄像头B。
S1503、终端设备获取该摄像头A采集的第一帧;
本申请的一些实施例中,终端设备确定该第一帧为模糊帧,才执行后续步骤。
S1504、终端设备获取该摄像头B采集的第二帧,该第二帧与该第一帧对应;
本申请的一些实施例中,终端设备可以判断摄像头B采集的帧是否为清晰帧,在采集的帧为清晰帧时,才将该清晰帧作为与该第一帧对应的第二帧。
步骤S1501-S1503可参考上述步骤S801~S807中的描述,此处不再赘述。
S1505、终端设备将该第二帧融合到该第一帧,得到去模糊帧;
本申请的一些实施例中,终端设备可以先确定从第二帧变换到第二帧的配准信息,再根据该配准信息将该第二帧融合到该第一帧,得到去模糊帧。
具体的,终端设备得到配准信息H4的方式有很多种:
在一些实施例中,可以直接将该第二帧与第一帧进行配准,得到该配准信息H4;
在一些实施例中,可以先将该第二帧与该第一帧进行下采样,再进行配准,得到该配准信息H4;
在一些实施例中,可以按照参考上述步骤S808~S814的方式进行配准。
还可以采用更多其他的方式进行配准,得到该配准信息H4,此处不作限定。
S1506、终端设备显示该去模糊帧的图像。
可参考上述步骤S815~S816,此处不作赘述。
本申请实施例中,终端设备启动摄像头A进行拍摄时,终端设备可以同时启动具备有OIS的摄像头B,使用具备有OIS的摄像头B采集的清晰帧对摄像头A采集的模糊帧进行去模糊处理,可以使得终端设备对模糊帧的去模糊效果更好,从而使得终端设备显示的画面的清晰度一致性更高。
结合图8与图14所示的实施例,如图16所示,本申请实施例还提供了另一种图像处理方法:
S1601、终端设备获取模糊帧M1与清晰帧Q1;
本申请实施例中,该模糊帧M1与清晰帧Q1的来源可以有很多种:
在一些实施例中,终端设备可以按照步骤S801~S807获取到模糊帧M1与清晰帧Q1;
在一些实施例中,终端设备可以按照步骤S1401~S1405获取到模糊帧M1与清晰帧Q1;
在一些实施例中,该模糊帧M1与清晰帧Q1可以为用户指定的;
在一些实施例中,该模糊帧M1与清晰帧Q1可以为终端设备按照默认规则从用户相册获取的;
还可以有很多获取该模糊帧M1与清晰帧Q1的方式,此处不作限定。
S1602、终端设备对该模糊帧M1进行下采样,并提取特征点T1;
S1603、终端设备对该清晰帧Q1进行下采样,并提取特征点T2;
S1604、终端设备根据特征点T1和特征点T2,生成全局低精度配准信息H1;
S1605、终端设备对该模糊帧M1进行裁切,并提取特征点T3;
S1606、终端设备对该清晰帧Q1进行裁切,并提取特征点T4;
S1607、终端设备根据特征点T3和特征点T4,生成局部高精度配准信息h2;
S1608、终端设备使用该局部高精度配准信息h2对全局低精度配准信息H1进行校正,得到全局高精度配准信息H3;
S1609、终端设备使用该全局高精度配准信息H3,将清晰帧Q1与模糊帧M1进行融合,得到去模糊帧F1;
S1610、终端设备显示该去模糊帧F1的图像。
步骤S1602~S1610与步骤S808~S816类似,可参考步骤S808~S816中的描述,此处不再赘述。
本申请实施例中,在进行去模糊处理时,终端设备将清晰帧和模糊帧分别进行下采样后提取特征点匹配得到全局低精度配准信息,分别裁切后提取特征点匹配得到局部高精度配准信息,再使用该局部高精度配准信息校准该全局低精度配准信息的方式得到去模糊处理所需的全局高精度信息,极大的降低了进行图像配准所需的算力,使得该终端设备即使为移动终端设备,也可能实现实时的去模糊处理,使得移动终端设备拍摄出的图像的清晰度一致性更高。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。
上述实施例中所用,根据上下文,术语“当…时”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从 一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘)等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。

Claims (29)

  1. 一种图像处理方法,其特征在于,包括:
    响应于用户的第一操作,终端设备启动第一摄像头;
    在检测到所述第一摄像头启动时,所述终端设备启动第二摄像头,其中所述第二摄像头配备OIS光学防抖;
    所述终端设备获取所述第一摄像头采集的第一帧;
    所述终端设备获取所述第二摄像头采集的第二帧,所述第二帧与所述第一帧对应;
    所述终端设备将所述第二帧融合到所述第一帧,得到去模糊帧;
    所述终端设备显示所述去模糊帧的图像。
  2. 根据权利要求1所述的方法,其特征在于,所述终端设备获取所述第二摄像头采集的第二帧之前,所述方法还包括:
    所述终端设备确定所述第一帧为模糊帧;
    所述终端设备将所述第二帧融合到所述第一帧,得到去模糊帧之前,所述方法还包括:
    所述终端设备确定所述第二帧为清晰帧。
  3. 根据权利要求1所述的方法,其特征在于,所述终端设备启动第二摄像头之前还包括:
    所述终端设备确定所述第一摄像头是否配备了OIS;
    若所述第一摄像头未配备OIS,启动所述第二摄像头。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述终端设备将所述第二帧融合到所述第一帧,得到去模糊帧,具体包括:
    所述终端设备确定将所述第二帧转换到所述第一帧的配准信息;
    所述终端设备根据所述配准信息,将所述第二帧融合到所述第一帧,得到所述去模糊帧。
  5. 根据权利要求4所述的方法,其特征在在于,所述终端设备确定将所述第二帧转换到所述第一帧的配准信息,具体包括:
    所述终端设备根据对所述第一帧和所述第二帧下采样后提取的特征点,生成全局低精度配准信息;
    所述终端设备根据对所述第一帧和所述第二帧裁切后提取的特征点,生成局部高精度配准信息;
    所述终端设备使用所述局部高精度配准信息校准所述全局低精度配准信息,得到全局高精度配准信息,作为将所述第二帧转换到所述第一帧的配准信息。
  6. 根据权利要求5所述的方法,其特征在于,所述终端设备根据对所述第一帧和所述第二帧下采样后提取的特征点,生成全局低精度配准信息,具体包括:
    所述终端设备按照第一下采样比率对所述第一帧下采样后提取特征点,得到第一特征点集合;
    所述终端设备按照所述第一下采样比率对所述第二帧下采样后提取特征点,得到第二特征点集合;
    所述终端设备根据所述第一特征点集合和所述第二特征点集合,生成将所述第二帧变换到所述第一帧的所述全局低精度配准信息。
  7. 根据权利要求5所述的方法,其特征在于,所述终端设备根据对所述第一帧和所述第二帧裁切后提取的特征点,生成局部高精度配准信息,具体包括:
    所述终端设备按照第一面积比值、第一中心点位置和第一形状对所述第一帧裁切,得到 第一裁切区域,对所述第一裁切区域提取特征点,得到第三特征点集合;所述第一面积比值为所述第一裁切区域的面积与第一帧的总面积的比值,所述第一形状为所述第一裁切区域的形状;所述第一中心点位置为所述第一裁切区域的中心点相对于所述第一帧的中心点的位置;
    所述终端设备按照所述第一面积比值、所述第一中心点位置和所述第一形状对所述第二帧裁切,得到第二裁切区域,对所述第二裁切区域提取特征点,得到第四特征点集合;
    所述终端设备根据所述第三特征点集合和所述第四特征点集合,生成将所述第二裁切区域变换到所述第一裁切区域的所述局部高精度配准信息。
  8. 根据权利要求6所述的方法,其特征在于,所述第一下采样比率为一个预设下采样比率;或所述第一下采样比率为所述终端设备根据实时运算能力确定的一个下采样比率。
  9. 根据权利要求7所述的方法,其特征在于,所述第一面积比值为一个预设比值;或所述第一面积比值为所述终端设备根据实时运算能力确定的一个比值。
  10. 根据权利要求7所述的方法,其特征在于,所述第一中心点位置为帧的中心点。
  11. 根据权利要求7所述的方法,其特征在于,所述第一形状为长方形或正方形。
  12. 根据权利要求1至11中任一项所述的方法,其特征在于,所述终端设备获取所述第二摄像头采集的第二帧,具体包括:
    所述终端设备发送清晰帧选择标识给所述第二摄像头,所述清晰帧选择标识从包括所述第一帧的时间信息和模糊程度信息;
    所述终端设备接收所述第二摄像头反馈的与所述第一帧对应的所述第二帧。
  13. 根据权利要求1至12中任一项所述的方法,其特征在于,所述第二帧为所述第二摄像头采集的帧中与所述第一帧的采集时间间隔在第一预设时长内,且模糊程度相比于所述第一帧的模糊程度不超出预设模糊阈值的一个帧。
  14. 一种终端设备,其特征在于,所述终端设备包括:一个或多个处理器、存储器、第一摄像头、第二摄像头和显示屏;
    所述存储器与所述一个或多个处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,所述一个或多个处理器调用所述计算机指令以使得所述终端设备执行:
    响应于用户的第一操作,启动第一摄像头;
    在检测到所述第一摄像头启动时,启动第二摄像头,其中所述第二摄像头配备OIS;
    获取所述第一摄像头采集的第一帧;
    获取所述第二摄像头采集的第二帧,所述第二帧与所述第一帧对应;
    将所述第二帧融合到所述第一帧,得到去模糊帧;
    显示所述去模糊帧的图像。
  15. 根据权利要求14所述的终端设备,其特征在于,所述一个或多个处理器,还用于调用所述计算机指令以使得所述终端设备执行:
    确定所述第一帧为模糊帧;
    确定所述第二帧为清晰帧。
  16. 根据权利要求14所述的终端设备,其特征在于,所述一个或多个处理器,还用于调用所述计算机指令以使得所述终端设备执行:
    确定所述第一摄像头是否配备了OIS;
    若所述第一摄像头未配备OIS,启动所述第二摄像头。
  17. 根据权利要求14至16中任一项所述的终端设备,其特征在于,所述一个或多个处理器,具体用于调用所述计算机指令以使得所述终端设备执行:
    确定将所述第二帧转换到所述第一帧的配准信息;
    根据所述配准信息,将所述第二帧融合到所述第一帧,得到所述去模糊帧。
  18. 根据权利要求17所述的终端设备,其特征在于,所述一个或多个处理器,具体用于调用所述计算机指令以使得所述终端设备执行:
    根据对所述第一帧和所述第二帧下采样后提取的特征点,生成全局低精度配准信息;
    根据对所述第一帧和所述第二帧裁切后提取的特征点,生成局部高精度配准信息;
    使用所述局部高精度配准信息校准所述全局低精度配准信息,得到全局高精度配准信息,作为将所述第二帧转换到所述第一帧的配准信息。
  19. 根据权利要求18所述的终端设备,其特征在于,所述一个或多个处理器,具体用于调用所述计算机指令以使得所述终端设备执行:
    按照第一下采样比率对所述第一帧下采样后提取特征点,得到第一特征点集合;
    按照所述第一下采样比率对所述第二帧下采样后提取特征点,得到第二特征点集合;
    根据所述第一特征点集合和所述第二特征点集合,生成将所述第二帧变换到所述第一帧的所述全局低精度配准信息。
  20. 根据权利要求18所述的终端设备,其特征在于,所述一个或多个处理器,具体用于调用所述计算机指令以使得所述终端设备执行:
    按照第一面积比值、第一中心点位置和第一形状对所述第一帧裁切,得到第一裁切区域,对所述第一裁切区域提取特征点,得到第三特征点集合;所述第一面积比值为所述第一裁切区域的面积与第一帧的总面积的比值,所述第一形状为所述第一裁切区域的形状;所述第一中心点位置为所述第一裁切区域的中心点相对于所述第一帧的中心点的位置;
    按照所述第一面积比值、所述第一中心点位置和所述第一形状对所述第二帧裁切,得到第二裁切区域,对所述第二裁切区域提取特征点,得到第四特征点集合;
    根据所述第三特征点集合和所述第四特征点集合,生成将所述第二裁切区域变换到所述第一裁切区域的所述局部高精度配准信息。
  21. 根据权利要求19所述的终端设备,其特征在于,所述第一下采样比率为一个预设下采样比率;或所述第一下采样比率为所述终端设备根据实时运算能力确定的一个下采样比率。
  22. 根据权利要求20所述的终端设备,其特征在于,所述第一面积比值为一个预设比值;或所述第一面积比值为所述终端设备根据实时运算能力确定的一个比值。
  23. 根据权利要求20所述的终端设备,其特征在于,所述第一中心点位置为帧的中心点。
  24. 根据权利要求20所述的终端设备,其特征在于,所述第一形状为长方形或正方形。
  25. 根据权利要求14至24中任一项所述的终端设备,其特征在于,所述一个或多个处理器,具体用于调用所述计算机指令以使得所述终端设备执行:
    发送清晰帧选择标识给所述第二摄像头,所述清晰帧选择标识从包括所述第一帧的时间信息和模糊程度信息;
    接收所述第二摄像头反馈的与所述第一帧对应的所述第二帧。
  26. 根据权利要求14至25中任一项所述的终端设备,其特征在于,所述第二帧为所述第二摄像头采集的帧中与所述第一帧的采集时间间隔在第一预设时长内,且模糊程度相比于所述第一帧的模糊程度不超出预设模糊阈值的一个帧。
  27. 一种芯片系统,所述芯片系统应用于终端设备,所述芯片系统包括一个或多个处理器, 所述处理器用于调用计算机指令以使得所述终端设备执行如权利要求1-13中任一项所述的方法。
  28. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在终端设备上运行时,使得所述终端设备执行如权利要求1-13中任一项所述的方法。
  29. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在终端设备上运行时,使得所述终端设备执行如权利要求1-13中任一项所述的方法。
PCT/CN2022/085763 2021-04-14 2022-04-08 图像处理方法和终端设备 WO2022218216A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22787442.7A EP4300941A1 (en) 2021-04-14 2022-04-08 Image processing method and terminal device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110402621.2 2021-04-14
CN202110402621.2A CN115225799A (zh) 2021-04-14 2021-04-14 图像处理方法和终端设备

Publications (1)

Publication Number Publication Date
WO2022218216A1 true WO2022218216A1 (zh) 2022-10-20

Family

ID=83605752

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/085763 WO2022218216A1 (zh) 2021-04-14 2022-04-08 图像处理方法和终端设备

Country Status (3)

Country Link
EP (1) EP4300941A1 (zh)
CN (1) CN115225799A (zh)
WO (1) WO2022218216A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090129674A1 (en) * 2007-09-07 2009-05-21 Yi-Chun Lin Device and method for obtaining clear image
GB2516918A (en) * 2013-08-06 2015-02-11 St Microelectronics Res & Dev Method and apparatus
US20180270424A1 (en) * 2017-03-20 2018-09-20 Motorola Mobility Llc Repositioning camera lenses during capturing of media
CN109688293A (zh) * 2019-01-28 2019-04-26 努比亚技术有限公司 一种拍摄方法、终端及计算机可读存储介质
CN110233970A (zh) * 2019-06-27 2019-09-13 Oppo广东移动通信有限公司 图像处理方法和装置、电子设备、计算机可读存储介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107071263B (zh) * 2016-12-30 2020-02-18 努比亚技术有限公司 一种图像处理方法及终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090129674A1 (en) * 2007-09-07 2009-05-21 Yi-Chun Lin Device and method for obtaining clear image
GB2516918A (en) * 2013-08-06 2015-02-11 St Microelectronics Res & Dev Method and apparatus
US20180270424A1 (en) * 2017-03-20 2018-09-20 Motorola Mobility Llc Repositioning camera lenses during capturing of media
CN109688293A (zh) * 2019-01-28 2019-04-26 努比亚技术有限公司 一种拍摄方法、终端及计算机可读存储介质
CN110233970A (zh) * 2019-06-27 2019-09-13 Oppo广东移动通信有限公司 图像处理方法和装置、电子设备、计算机可读存储介质

Also Published As

Publication number Publication date
CN115225799A (zh) 2022-10-21
EP4300941A1 (en) 2024-01-03

Similar Documents

Publication Publication Date Title
WO2021136050A1 (zh) 一种图像拍摄方法及相关装置
WO2020186969A1 (zh) 一种多路录像方法及设备
CN112333380B (zh) 一种拍摄方法及设备
WO2020192461A1 (zh) 一种延时摄影的录制方法及电子设备
WO2020073959A1 (zh) 图像捕捉方法及电子设备
WO2020238741A1 (zh) 图像处理方法、相关设备及计算机存储介质
WO2021129198A1 (zh) 一种长焦场景下的拍摄方法及终端
CN113810601B (zh) 终端的图像处理方法、装置和终端设备
WO2022057723A1 (zh) 一种视频的防抖处理方法及电子设备
WO2022100685A1 (zh) 一种绘制命令处理方法及其相关设备
CN113556466B (zh) 一种对焦方法和电子设备
WO2021057626A1 (zh) 图像处理方法、装置、设备及计算机存储介质
CN113572956A (zh) 一种对焦的方法及相关设备
CN113452898A (zh) 一种拍照方法及装置
WO2021179186A1 (zh) 一种对焦方法、装置及电子设备
WO2021175096A1 (zh) 一种非视距物体的成像方法和电子设备
CN113592751A (zh) 图像处理方法、装置和电子设备
CN113850709A (zh) 图像变换方法和装置
CN113781548A (zh) 多设备的位姿测量方法、电子设备及系统
WO2022033344A1 (zh) 视频防抖方法、终端设备和计算机可读存储介质
WO2022218216A1 (zh) 图像处理方法和终端设备
CN115484383B (zh) 拍摄方法及相关装置
CN115150542B (zh) 一种视频防抖方法及相关设备
CN114302063B (zh) 一种拍摄方法及设备
CN115706869A (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: 22787442

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022787442

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022787442

Country of ref document: EP

Effective date: 20230929

NENP Non-entry into the national phase

Ref country code: DE