Focusing method and device, electronic equipment and storage medium

By dividing the displayed image frame into multiple windows and determining the focus area based on pixel information and phase difference data, the problem of insufficient stability of camera autofocus in a specific scene is solved, and higher focus stability and shooting effects are achieved.

CN120034734APending Publication Date: 2025-05-23BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311559749.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The existing camera autofocus technology is insufficient in scenes such as flat areas, night scenes and point light sources, affecting imaging quality and user experience.

Method used

Accurate focus is performed by dividing the displayed image frame into multiple windows, including a central window and a peripheral window, and determining the focus area and target phase difference values ​​based on the pixel information and phase difference data of each window, and accurately focusing.

Benefits of technology

It improves the focus stability of the phase detection focus method, improves the shooting effect and user experience, and is suitable for a variety of scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034734A_ABST
    Figure CN120034734A_ABST
Patent Text Reader

Abstract

The invention relates to a focusing method and device, electronic equipment and a storage medium, and relates to the technical field of camera focusing. The method comprises the following steps: dividing a current display image frame into a plurality of windows; the plurality of windows comprise a central window and at least one peripheral window, and the at least one peripheral window comprises other windows except the central window in the plurality of windows; dividing the central window into a plurality of different first sub-windows; determining a target phase difference value of the focusing area according to the pixel information and the phase difference data of the plurality of first sub-windows, and / or the pixel information and the phase difference data of the at least one peripheral window; and focusing based on the target phase difference value. The target phase difference value is accurately determined by combining the pixel information and the phase difference data of the plurality of windows in the display image frame, so that the focusing stability of the phase detection focusing method can be improved, the shooting effect can be improved, the user experience can be improved, and the phase detection focusing method is suitable for various scenes such as night scenes, flat areas and point light sources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of camera focusing, and in particular to a focusing method, device, electronic device and storage medium. Background Art

[0002] In recent years, with the development of economy and the advancement of science and technology, taking photos and recording has become a part of people's lives. As an important part of camera imaging, the quality of autofocus is very important. At present, the stability of autofocus is not good enough for scenes such as flat areas, night scenes, and point light sources. The stability of autofocus directly affects the quality of imaging and the user experience. Therefore, research on improving the stability of autofocus is very necessary. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a focusing method, device, electronic device and storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided a focusing method, comprising:

[0005] In response to being in a photo preview state, dividing the current display image frame into a plurality of windows; the plurality of windows include a central window and at least one peripheral window, and the at least one peripheral window includes other windows among the plurality of windows except the central window;

[0006] Dividing the central window into a plurality of different first sub-windows;

[0007] Determine a focus area and a target phase difference value of the focus area according to the pixel information and phase difference data of the plurality of first sub-windows and / or the pixel information and phase difference data of the at least one peripheral window;

[0008] Focusing is performed based on the target phase difference value.

[0009] According to a second aspect of an embodiment of the present disclosure, there is provided a focusing device, comprising:

[0010] A first division module is used to divide the current display image frame into a plurality of windows; the plurality of windows include a central window and at least one peripheral window, and the at least one peripheral window includes other windows of the plurality of windows except the central window;

[0011] A second division module, used for dividing the central window into a plurality of different first sub-windows;

[0012] A determination module, configured to determine a focus area and a target phase difference value of the focus area according to the pixel information and phase difference data of the plurality of first sub-windows and / or the pixel information and phase difference data of the at least one peripheral window;

[0013] A focusing module is used to focus based on the target phase difference value.

[0014] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect above is implemented.

[0015] According to a fourth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in the first aspect is implemented.

[0016] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: by combining the pixel information and phase difference data of each of the multiple windows in the current display image frame, the target phase difference value can be accurately determined, thereby improving the focusing stability of the phase detection focusing method, improving the shooting effect, and improving the user experience, and is suitable for various scenes such as night scenes, flat areas, point light sources, etc.

[0017] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0019] Figure 1 The figure is a flow chart of a focusing method according to an exemplary embodiment.

[0020] Figure 2 The diagram is a schematic diagram of a window for displaying an image frame according to an exemplary embodiment.

[0021] Figure 3 is a flow chart showing another focusing method according to an exemplary embodiment.

[0022] Figure 4 is a flow chart of yet another focusing method according to an exemplary embodiment.

[0023] Figure 5 is a structural block diagram of a focusing device according to an exemplary embodiment.

[0024] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0025] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0026] At present, cameras usually use the phase detection focus PDAF method for autofocus. In order to make the focus fall on the object of interest to the user, a multi-window focus strategy is usually used when using PDAF for focusing. The multi-window focus strategy is to divide the current frame in the display interface into multiple windows, and then focus based on the phase difference data of multiple windows. However, for some scenes such as flat areas or point light sources that are not conducive to PDAF focusing, since some windows will contain these unfavorable factors, the phase difference data of some windows may become inaccurate, and ultimately lead to PDAF focusing failure.

[0027] To this end, the present disclosure proposes a focusing method, device, electronic device and storage medium to be applicable to a variety of scenarios and improve focusing stability. Figure 1 is a flow chart of a focusing method according to an exemplary embodiment. It should be noted that the focusing method of the embodiment of the present disclosure can be used in the focusing device in the embodiment of the present disclosure, and the focusing device in the embodiment of the present disclosure can be configured in an electronic device. Figure 1 As shown, the focusing method may include but is not limited to the following steps.

[0028] Step 101, in response to being in a photo preview state, dividing the current display image frame into multiple windows, wherein the multiple windows include a central window and at least one peripheral window, and the at least one peripheral window includes other windows among the multiple windows except the central window.

[0029] Figure 2 FIG. 1 is a schematic diagram of a window for displaying an image frame according to an exemplary embodiment. Figure 2 As shown, when the electronic device with a shooting function is currently in a shooting preview state, the current display image frame is divided into multiple windows ( Figure 2 Take 3*3 windows as an example). Among them, window 5 can be regarded as the central window, and the central window can be understood as at least one window that displays the middle of the image frame. The peripheral windows include other windows in the plurality of windows except the central window, and the peripheral windows can be understood as windows surrounding the central window. For example, in Figure 2 In the embodiment of the present disclosure, at least one of window 1 to window 4 and window 6 to window 9 can be used as a peripheral window. In other embodiments of the present disclosure, the current display image frame can be divided into m*n windows, and at least one window in the middle of the display image frame is determined as a central window, which is not limited in the present disclosure.

[0030] Step 102: divide the central window into a plurality of different first sub-windows.

[0031] by Figure 2 As an example, the central window - window 5 is further divided into a plurality of different first sub-windows ( Figure 2 In the example, the first sub-window is divided into 5*5).

[0032] Step 103: Determine a focus area and a target phase difference value of the focus area according to pixel information and phase difference data of the plurality of first sub-windows and / or pixel information and phase difference data of at least one peripheral window.

[0033] The phase difference data includes a phase difference value. Alternatively, the phase difference data may also include a phase difference value, confidence information of the phase difference, and a defocus value.

[0034] In some embodiments of the present disclosure, any one or more first sub-windows may be determined as a focus area. Based on the pixel information and phase difference data of the multiple first sub-windows, the target phase difference value of the focus area is determined. As a possible implementation method, the degree of overexposure of each first sub-window may be determined by the pixel information of each first sub-window. An overexposure weight value corresponding to each first sub-window is assigned according to the degree of overexposure of each first sub-window, and the higher the degree of overexposure, the lower the overexposure weight value. Based on the overexposure weight value of each first sub-window, the phase difference values ​​of the multiple first sub-windows in the displayed image frame are weighted and averaged to determine the target phase difference value of the focus area.

[0035] In another implementation, there is a mapping relationship between pixel information and overexposure weight, and the overexposure weight value of each first sub-window can be determined by using the pixel information of each first sub-window and the mapping relationship.

[0036] Optionally, in some embodiments of the present disclosure, if the credibility of the target phase difference value determined based on the pixel information and phase difference data of multiple first sub-windows does not meet a preset condition (such as the credibility does not reach a preset threshold), the target phase difference value of the focus area can be determined based on the pixel information and phase difference data of at least one peripheral window.

[0037] Optionally, in some embodiments of the present disclosure, the focus area and the target phase difference value of the focus area can also be determined based on the pixel information and phase difference data of multiple first sub-windows, and the pixel information and phase difference data of at least one peripheral window. Any one or more first sub-windows are determined as the focus area. The phase difference values ​​of multiple first sub-windows are weighted and averaged based on the overexposure weight of each first sub-window, and the phase difference values ​​of the corresponding peripheral windows are weighted and averaged based on the overexposure weight of at least one peripheral window, and the target phase difference value is determined based on the weighted average results of multiple first sub-windows and the weighted average results of at least one peripheral window.

[0038] Step 104: focusing based on the target phase difference value.

[0039] By implementing the embodiments of the present disclosure, the target phase difference value can be accurately determined by combining the pixel information and phase difference data of each of the multiple windows in the current display image frame, thereby improving the focusing stability of the phase detection focusing method, improving the shooting effect, and improving the user experience. It is suitable for various scenes such as night scenes, flat areas, point light sources, etc.

[0040] Figure 3 FIG. 1 is a flow chart of another focusing method according to an exemplary embodiment. Figure 3 As shown, the focusing method may include but is not limited to the following steps.

[0041] Step 301, in response to being in a photo preview state, dividing the current display image frame into multiple windows, wherein the multiple windows include a central window and at least one peripheral window, and the at least one peripheral window includes other windows among the multiple windows except the central window.

[0042] Step 302: divide the central window into a plurality of different first sub-windows.

[0043] Step 303: Determine the total weight value of each first sub-window according to the pixel information of each first sub-window and the phase difference data of each first sub-window.

[0044] Optionally, the phase difference data includes a phase difference value, confidence information of the phase difference, and a defocus value.

[0045] In some embodiments of the present disclosure, an overexposure weight value corresponding to each window can be assigned based on the pixel information of each window. The higher the overexposure degree, the lower the overexposure weight value. A confidence weight value corresponding to each first subwindow is assigned based on the confidence information of the phase difference of each first subwindow. The higher the confidence information of the phase difference, the higher the confidence weight value. Based on the overexposure weight value and the confidence weight value corresponding to each first subwindow, the total weight value of each first subwindow is determined. The total weight value of the first subwindow can represent the weights of the two dimensions of the overexposure degree and the confidence information of the phase difference. The higher the total weight value, the lower the overexposure degree and the higher the confidence information of the phase difference.

[0046] As an example, the overexposure weight value and the confidence weight value corresponding to each first sub-window may be multiplied to obtain the total weight value of each first sub-window. Alternatively, the total weight value of each first sub-window may be determined by other technical means based on the overexposure weight value and the confidence weight value corresponding to each first sub-window, which is not limited in the embodiments of the present disclosure.

[0047] Step 304: clustering the multiple first sub-windows based on the phase difference data of each first sub-window to obtain a first region containing the largest number of first sub-windows.

[0048] Among them, the phase difference data of the first sub-windows in the first area are not much different. In one implementation, multiple first sub-windows can be clustered based on the defocus value in the phase difference data of each first sub-window. As an example, multiple first sub-windows in the current display image frame can be sorted in order from small to large according to the defocus value. If the difference between the defocus values ​​of the two first sub-windows with the smallest defocus value is less than a preset threshold, the two first sub-windows can be clustered into the same area, and the average value of the defocus values ​​of the two first sub-windows is used as the defocus value of the area. Then it is determined whether the difference between the defocus value of the next first sub-window with the smallest defocus value and the defocus value of the area is less than or equal to the preset threshold. If the difference is less than the preset threshold, the first sub-window is merged with the area. If the difference is greater than the preset threshold, the first sub-window is classified as another area. Based on this list, clustering is performed based on the difference between the defocus values ​​of the first sub-window and the existing area, until all the first sub-windows are clustered, at least one area is obtained, and the area containing the largest number of first sub-windows is used as the first area. This clustering method is simple to calculate and can save computing power and resources.

[0049] In another implementation, multiple first sub-windows may be clustered based on the phase difference data of each first sub-window using other clustering algorithms, such as the K-Means algorithm, to obtain at least one region, which is not limited in the present disclosure.

[0050] Step 305: Determine first phase difference information of the first region based on the total weight value and phase difference data of the first sub-window in the first region.

[0051] In one implementation, the phase difference values ​​of the corresponding windows may be weighted and averaged based on the total weight value of each first sub-window in the first region, thereby determining the first phase difference information of the first region. This embodiment introduces weights of two dimensions, pixel information and phase difference confidence information, to make the target phase difference value of the determined focus area more accurate.

[0052] Step 306: In response to the credibility of the first phase difference information satisfying a preset condition, the first area is determined as a focus area, and the first phase difference information of the first area is determined as a target phase difference value of the focus area.

[0053] Step 307 : in response to the credibility of the first phase difference information not satisfying a preset condition, determining a focus area and a target phase difference value of the focus area according to pixel information and phase difference data of at least one peripheral window.

[0054] Wherein, the credibility of the first phase difference information does not meet the preset condition, which may be that the credibility of the first phase difference information does not reach a preset threshold. Optionally, when the number of peripheral windows is 1, the peripheral window can be directly determined as the focus area. The target phase difference value of the focus area is determined by the pixel information and phase difference data of the peripheral window. Wherein, the determination of the phase difference value can refer to the relevant description in the above embodiment.

[0055] Optionally, when there are multiple peripheral windows, the multiple peripheral windows can be clustered to determine the focus area. In one implementation, the total weight value of each peripheral window can be determined based on the pixel information of each peripheral window and the phase difference data of each peripheral window. Based on the phase difference data of each peripheral window, the multiple peripheral windows are clustered to obtain a second area containing the largest number of peripheral windows. Based on the total weight value and phase difference data of the peripheral windows in the second area, the second phase difference information of the second area is determined, the second area is determined as the focus area, and the second phase difference information of the second area is determined as the target phase difference value of the focus area.

[0056] Step 308: focusing based on the target phase difference value.

[0057] By implementing the embodiments of the present disclosure, the total weight value of each first sub-window is determined based on the two dimensions of the pixel information and phase difference data of the first sub-window, and the multiple first sub-windows are clustered based on the phase difference data, so as to determine the first area. In combination with the phase difference data and the total weight value of the first sub-window in the first area, the first phase difference information of the first area can be accurately determined. When the credibility of the first phase difference information does not meet the preset conditions, the target phase difference value of the focus area is determined according to the pixel information and phase difference data of the peripheral window. The present disclosure can accurately determine the target phase difference value, thereby further improving the focusing stability of the phase detection focusing method, further improving the shooting effect, and improving the user experience, and is suitable for a variety of scenes such as night scenes, flat areas, and point light sources.

[0058] Figure 4 FIG. 1 is a flow chart of another focusing method according to an exemplary embodiment. Figure 4 As shown, the focusing method may include but is not limited to the following steps.

[0059] Step 401, in response to being in a photo preview state, dividing the current display image frame into multiple windows; the multiple windows include a central window and at least one peripheral window, and the at least one peripheral window includes other windows in the multiple windows except the central window.

[0060] Step 402: divide the central window into a plurality of different first sub-windows.

[0061] Step 403: Determine the total weight value of each first sub-window according to the pixel information of each first sub-window and the phase difference data of each first sub-window.

[0062] Step 404: clustering the multiple first sub-windows based on the phase difference data of each first sub-window to obtain a first region containing the largest number of first sub-windows.

[0063] Step 405: Determine first phase difference information of the first region based on the total weight value and phase difference data of the first sub-window in the first region.

[0064] Step 406: In response to the credibility of the first phase difference information satisfying a preset condition, the first area is determined as a focus area, and the first phase difference information of the first area is determined as a target phase difference value of the focus area.

[0065] Step 407: In response to the credibility of the first phase difference information not satisfying a preset condition, at least one peripheral window is divided into a plurality of different second sub-windows. The size of the second sub-window is smaller than the size of the peripheral window.

[0066] Step 408: Determine the focus area and the target phase difference value of the focus area according to the pixel information and phase difference data of the plurality of second sub-windows.

[0067] In one implementation, the total weight value of each second sub-window may be determined based on the pixel information and phase difference data of each second sub-window. Based on the phase difference data of each second sub-window, multiple second sub-windows are clustered to obtain a third area containing the most second sub-windows. Based on the total weight value and phase difference data of the second sub-windows in the third area, the third phase difference information in the third area is determined. The third area is determined as the focus area, and the third phase difference information of the third area is determined as the target phase difference value of the focus area.

[0068] Step 409: focusing based on the target phase difference value.

[0069] In the embodiment of the present disclosure, step 401 to step 406 can be implemented in any manner in the embodiments of the present disclosure, and the embodiment of the present disclosure does not limit this and will not be described in detail.

[0070] By implementing the embodiments of the present disclosure, the total weight value of each first sub-window is determined based on the two dimensions of the pixel information and phase difference data of the first sub-window, and the multiple first sub-windows are clustered based on the phase difference data to determine the first area. In combination with the phase difference data and the total weight value of the first sub-window in the first area, the first phase difference information of the first area can be accurately determined. When the credibility of the first phase difference information does not meet the preset conditions, the peripheral window is divided more finely, and the peripheral window is divided into multiple second sub-windows, and the target phase difference value of the focus area is determined according to the pixel information and phase difference data of the second sub-window. The present disclosure can accurately determine the target phase difference value, thereby further improving the focusing stability of the phase detection focusing method, further improving the shooting effect, and improving the user experience, and is suitable for a variety of scenes such as night scenes, flat areas, and point light sources.

[0071] Figure 5 FIG. 1 is a structural block diagram of a focusing device according to an exemplary embodiment. Figure 5 As shown, the focusing device may include: a first division module 501 , a second division module 502 , a determination module 503 and a focusing module 504 .

[0072] The first division module 501 is used to divide the current display image frame into multiple windows in response to being in the current photo preview state. The multiple windows include a central window and at least one peripheral window, and the at least one peripheral window includes other windows in the multiple windows except the central window.

[0073] The second division module 502 is used to divide the central window into a plurality of different first sub-windows.

[0074] The determination module 503 is used to determine the focus area and the target phase difference value of the focus area according to the pixel information and phase difference data of the multiple first sub-windows and / or the pixel information and phase difference data of at least one peripheral window.

[0075] The focusing module 504 is used to perform focusing based on the target phase difference value.

[0076] In some embodiments of the present disclosure, the determination module 503 includes:

[0077] A first determining unit, used to determine a total weight value of each first sub-window according to pixel information of each first sub-window and phase difference data of each first sub-window;

[0078] A clustering unit, configured to cluster the plurality of first sub-windows based on the phase difference data of each first sub-window, to obtain a first region containing the largest number of first sub-windows;

[0079] A second determining unit, configured to determine first phase difference information of the first region based on the total weight value and phase difference data of the first sub-window in the first region;

[0080] a third determining unit, configured to determine the first area as a focus area and determine the first phase difference information of the first area as a target phase difference value of the focus area in response to the credibility of the first phase difference information satisfying a preset condition;

[0081] The fourth determining unit is used to determine the focus area and the target phase difference value of the focus area according to the pixel information and phase difference data of at least one peripheral window in response to the credibility of the first phase difference information not meeting the preset condition.

[0082] In some embodiments of the present disclosure, the first determination unit is specifically used to: determine the overexposure weight value of each first subwindow based on the pixel information of each first subwindow; determine the confidence weight value of each first subwindow based on the phase difference data of each first subwindow; determine the total weight value of each first subwindow based on the overexposure weight value and confidence weight value of each first subwindow.

[0083] In some embodiments of the present disclosure, the second determination unit is specifically used to: perform weighted averaging processing on the phase difference data of the first subwindow in the first area and the corresponding total weight value, and determine the first phase difference information of the first area based on the data obtained after the weighted averaging processing.

[0084] In some embodiments of the present disclosure, at least one peripheral window includes multiple peripheral windows; the fourth determination unit is specifically used to: determine the total weight value of each peripheral window based on pixel information of each peripheral window and phase difference data of each peripheral window; cluster the multiple peripheral windows based on the phase difference data of each peripheral window to obtain a second area containing the largest number of peripheral windows; determine second phase difference information of the second area based on the total weight value and phase difference data of the peripheral windows in the second area; determine the second area as a focus area, and determine the second phase difference information of the second area as a target phase difference value of the focus area.

[0085] In some embodiments of the present disclosure, the fourth determination unit is specifically used to: divide at least one peripheral window into multiple different second sub-windows; the size of the second sub-window is smaller than the size of the peripheral window; determine the focus area and the target phase difference value of the focus area based on the pixel information and phase difference data of the multiple second sub-windows.

[0086] In some embodiments of the present disclosure, the fourth determination unit is specifically used to: determine the total weight value of each second sub-window based on the pixel information of each second sub-window and the phase difference data of each second sub-window; cluster multiple second sub-windows based on the phase difference data of each second sub-window to obtain a third area containing the largest number of second sub-windows; determine the third phase difference information of the third area based on the total weight value and phase difference data of the second sub-windows in the third area; determine the third area as a focus area, and determine the third phase difference information of the third area as the target phase difference value of the focus area.

[0087] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0088] Figure 6 6 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 600 may be a terminal including an image acquisition device, such as a hardware device such as a mobile phone, or a camera (such as a digital camera).

[0089] Reference Figure 6 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0090] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0091] The memory 604 is configured to store various types of data to support operations on the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0092] The power component 606 provides power to the various components of the electronic device 600. The power component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.

[0093] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0094] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0095] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0096] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of the components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0097] The communication component 616 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0098] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0099] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0100] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0101] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A focusing method, It is characterized in that include: In response to being in a photo preview state, dividing the current display image frame into a plurality of windows; the plurality of windows include a central window and at least one peripheral window, and the at least one peripheral window includes other windows among the plurality of windows except the central window; Dividing the central window into a plurality of different first sub-windows; Determine a focus area and a target phase difference value of the focus area according to the pixel information and phase difference data of the plurality of first sub-windows and / or the pixel information and phase difference data of the at least one peripheral window; Focusing is performed based on the target phase difference value.

2. The method according to claim 1, It is characterized in that Determining the target phase difference value between the focus area and the focus area according to the pixel information and phase difference data of the plurality of first sub-windows and / or the pixel information and phase difference data of the at least one peripheral window includes: Determine a total weight value of each of the first sub-windows according to the pixel information of each of the first sub-windows and the phase difference data of each of the first sub-windows; Clustering the plurality of first sub-windows based on the phase difference data of each of the first sub-windows to obtain a first region containing the largest number of the first sub-windows; Determine first phase difference information of the first area based on the total weight value and phase difference data of the first sub-window in the first area; In response to the credibility of the first phase difference information satisfying a preset condition, determining the first area as the focus area, and determining the first phase difference information of the first area as a target phase difference value of the focus area; In response to the credibility of the first phase difference information not satisfying the preset condition, the focus area and the target phase difference value of the focus area are determined according to the pixel information and phase difference data of the at least one peripheral window.

3. The method according to claim 2, It is characterized in that The determining the total weight value of each first sub-window according to the pixel information of each first sub-window and the phase difference data of each first sub-window comprises: Determining an overexposure weight value of each of the first sub-windows according to pixel information of each of the first sub-windows; Determining a confidence weight value of each of the first sub-windows according to the phase difference data of each of the first sub-windows; A total weight value of each of the first sub-windows is determined according to the overexposure weight value and the confidence weight value of each of the first sub-windows.

4. The method according to claim 2 or 3, It is characterized in that The determining, based on the total weight value and phase difference data of the first sub-window in the first area, first phase difference information of the first area includes: The phase difference data of the first sub-window in the first area and the corresponding total weight value are subjected to weighted averaging processing, and the first phase difference information of the first area is determined according to the data obtained after the weighted averaging processing.

5. The method according to claim 2, It is characterized in that The at least one peripheral window includes a plurality of peripheral windows; and determining the focus area and the target phase difference value of the focus area according to the pixel information and phase difference data of the plurality of peripheral windows, comprising: Determine a total weight value of each of the peripheral windows according to the pixel information of each of the peripheral windows and the phase difference data of each of the peripheral windows; Clustering the plurality of peripheral windows based on the phase difference data of each peripheral window to obtain a second region containing the largest number of peripheral windows; Determining second phase difference information of the second area based on the total weight value and phase difference data of the peripheral window in the second area; The second area is determined as the focus area, and the second phase difference information of the second area is determined as the target phase difference value of the focus area.

6. The method according to claim 2, It is characterized in that The step of determining the focus area and the target phase difference value of the focus area according to the pixel information and the phase difference data of the at least one peripheral window comprises: dividing the at least one peripheral window into a plurality of different second sub-windows; the size of the second sub-windows is smaller than the size of the peripheral window; The focus area and the target phase difference value of the focus area are determined according to the pixel information and the phase difference data of the plurality of second sub-windows.

7. The method according to claim 6, It is characterized in that The step of determining the target phase difference value between the focus area and the focus area according to the pixel information and the phase difference data of the plurality of second sub-windows includes: Determine a total weight value of each second sub-window according to the pixel information of each second sub-window and the phase difference data of each second sub-window; Clustering the plurality of second sub-windows based on the phase difference data of each of the second sub-windows to obtain a third region containing the largest number of the second sub-windows; Determine third phase difference information of the third area based on the total weight value and phase difference data of the second sub-window in the third area; The third area is determined as the focus area, and the third phase difference information of the third area is determined as the target phase difference value of the focus area.

8. A focusing device, It is characterized in that include: A first division module is used for dividing the current display image frame into a plurality of windows in response to being in a photo preview state; the plurality of windows include a central window and at least one peripheral window, and the at least one peripheral window includes other windows of the plurality of windows except the central window; A second division module, used for dividing the central window into a plurality of different first sub-windows; A determination module, configured to determine a focus area and a target phase difference value of the focus area according to the pixel information and phase difference data of the plurality of first sub-windows and / or the pixel information and phase difference data of the at least one peripheral window; A focusing module is used to focus based on the target phase difference value.

9. The device as claimed in claim 8, It is characterized in that The determination module comprises: A first determining unit, configured to determine a total weight value of each of the first sub-windows according to pixel information of each of the first sub-windows and phase difference data of each of the first sub-windows; a clustering unit, configured to cluster the plurality of first sub-windows based on the phase difference data of each of the first sub-windows, to obtain a first region containing the largest number of the first sub-windows; A second determining unit, configured to determine first phase difference information of the first area based on the total weight value and phase difference data of the first sub-window in the first area; a third determining unit, configured to determine the first area as the focus area, and determine the first phase difference information of the first area as a target phase difference value of the focus area in response to the credibility of the first phase difference information satisfying a preset condition; A fourth determining unit is used to determine the focus area and the target phase difference value of the focus area according to the pixel information and phase difference data of the at least one peripheral window in response to the credibility of the first phase difference information not meeting the preset condition.

10. The device according to claim 9, It is characterized in that The first determining unit is specifically configured to: Determining an overexposure weight value of each of the first sub-windows according to pixel information of each of the first sub-windows; Determining a confidence weight value of each of the first sub-windows according to the phase difference data of each of the first sub-windows; A total weight value of each of the first sub-windows is determined according to the overexposure weight value and the confidence weight value of each of the first sub-windows.

11. The device according to claim 9 or 10, It is characterized in that The second determining unit is specifically configured to: The phase difference data of the first sub-window in the first area and the corresponding total weight value are subjected to weighted averaging processing, and the first phase difference information of the first area is determined according to the data obtained after the weighted averaging processing.

12. The device according to claim 9, It is characterized in that The at least one peripheral window includes a plurality of peripheral windows; and the fourth determining unit is specifically configured to: Determine a total weight value of each of the peripheral windows according to the pixel information of each of the peripheral windows and the phase difference data of each of the peripheral windows; Clustering the plurality of peripheral windows based on the phase difference data of each peripheral window to obtain a second region containing the largest number of peripheral windows; Determining second phase difference information of the second area based on the total weight value and phase difference data of the peripheral window in the second area; The second area is determined as the focus area, and the second phase difference information of the second area is determined as the target phase difference value of the focus area.

13. The device according to claim 9, It is characterized in that The fourth determining unit is specifically configured to: dividing the at least one peripheral window into a plurality of different second sub-windows; the size of the second sub-windows is smaller than the size of the peripheral window; The focus area and the target phase difference value of the focus area are determined according to the pixel information and the phase difference data of the plurality of second sub-windows.

14. The device according to claim 13, It is characterized in that The fourth determining unit is specifically configured to: Determine a total weight value of each second sub-window according to the pixel information of each second sub-window and the phase difference data of each second sub-window; Clustering the plurality of second sub-windows based on the phase difference data of each of the second sub-windows to obtain a third region containing the largest number of the second sub-windows; Determine third phase difference information of the third area based on the total weight value and phase difference data of the second sub-window in the third area; The third area is determined as the focus area, and the third phase difference information of the third area is determined as the target phase difference value of the focus area.

15. An electronic device, It is characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to claims 1 to 7 is implemented.

16. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to claims 1 to 7 is implemented.