Focusing method, focusing device, terminal and computer readable storage medium

By introducing voice focus mode and time-of-flight image sensors into the terminal, users can select the focus area through voice, solving the problem of unsatisfactory autofocus and improving focus efficiency and accuracy.

CN119629472APending Publication Date: 2025-03-14SMARTSENS TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311188136.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-14
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When the autofocus result is not ideal, a manual intervention is required to manually select the focus area. When the manual cannot operate, the camera terminal is prone to being in the autofocus process for a long time or even being unable to focus.

Method used

It provides a focusing method, including entering the voice focus mode when the terminal focus result does not meet the preset conditions, obtaining depth information through the time-of-flight image sensor, performing clustering processing and parameter range setting, dividing the image into several areas, and selecting the focus area through the voice input for refocusing.

Benefits of technology

This enables users to select the focus area through voice, improves focus efficiency and accuracy, and avoids autofocus failure or long-term waiting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629472A_ABST
    Figure CN119629472A_ABST
Patent Text Reader

Abstract

The invention discloses a focusing method, a focusing device, a terminal and a computer readable storage medium, under the condition that an automatic focusing result of the terminal is not ideal, the terminal is controlled to enter a voice focusing mode, a user can select a focusing area expected by the user from an image preview interface in a voice mode, and the user experience is improved. Focusing can be carried out based on a focusing area expected by a user, and the user experience can be improved. The depth information of the to-be-focused object is obtained by introducing the flight time image sensor, the parameter range corresponding to the image picture is divided in a clustering processing mode and is presented on the image preview interface, and a user can obtain the expected focusing area under the prompt of the depth information and select the expected focusing area as the to-be-focused area, so that the focusing effect of the to-be-focused object is improved. Therefore, the focusing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of focusing technology, and in particular to a focusing method, a focusing device, a terminal and a computer-readable storage medium. Background Art

[0002] Focusing usually refers to adjusting the focal distance of a camera terminal to make the image of the object clear. Focusing is also called light alignment or focusing. The camera terminal is usually a terminal with a camera function, for example, it can be a camera or a mobile phone.

[0003] In the related art, camera terminals usually take photos through autofocus. When the autofocus result is not ideal, human intervention is often required to manually select the focus area. When human hands cannot operate, the camera terminal is prone to being in the autofocus process for a long time or even failing to focus. Summary of the invention

[0004] The purpose of the present application is to provide a focusing method, which aims to solve the problem in the related art that when the autofocus result is not ideal, manual intervention is often required to manually select the focus area. When the human hand cannot operate, it is easy for the camera terminal to be in the autofocus process for a long time or even unable to focus.

[0005] The first aspect of the present application provides a focusing method, comprising:

[0006] When the terminal focus result image does not meet the preset condition and the voice focus function of the terminal is in an available state, controlling the terminal to enter the voice focus mode;

[0007] Presenting an image preview interface and enabling a time-of-flight image sensor to obtain depth information of the image to be focused;

[0008] Performing clustering processing on the depth information and setting a parameter range;

[0009] Dividing the to-be-focused image into a plurality of regions according to the parameter range to obtain a plurality of the to-be-focused regions, and numbering the plurality of the to-be-focused regions;

[0010] The voice input selects the number corresponding to any of the areas to be focused, and controls the terminal to refocus based on the selected area to be focused.

[0011] In the present application, before dividing the image to be focused into a plurality of regions according to the parameter range to obtain a plurality of the regions to be focused, the focusing method further includes:

[0012] A fusion calculation is performed on the depth information map and the image to be focused to obtain a depth image to be focused that overlaps with the depth information map.

[0013] When performing fusion calculation on the depth information map and the image to be focused, the focusing method further includes:

[0014] Storing the depth information map and the image to be focused in a storage unit;

[0015] The depth image is calculated according to pixels and a conversion matrix to obtain a depth image to be focused that overlaps with the image to be focused.

[0016] Before controlling the terminal to enter the voice focus mode, the focusing method further includes:

[0017] A preset control interface is presented, and if a function activation operation for the preset control interface is detected, the voice focus function of the terminal is set to an available state.

[0018] Before controlling the terminal to enter the voice focus mode, the focusing method further includes:

[0019] A preset control interface is presented, and if a function activation operation for the preset control interface is detected, the voice focus function of the terminal is set to an available state.

[0020] In the present application, when the terminal focus result image does not meet the preset conditions and the voice focus function of the terminal is in an available state, the terminal is controlled to enter the voice focus mode, and the preset conditions include at least one of the following:

[0021] The focus area of ​​the focus result image is the area expected by the photographer, the average pixel value of the area expected by the photographer in the focus result image is within the preset pixel threshold range, the average brightness of the pixels in the preset area in the focus result image is greater than or equal to the preset brightness value, and the autofocus time is greater than the preset duration.

[0022] In the present application, after clustering the depth information and setting the parameter range, the focusing method further includes:

[0023] When the distance between the object to be focused and the camera lens is less than or equal to 3 meters, the number of parameter ranges is 2 N group, where N is a positive integer greater than or equal to 1, and 6≤N≤8;

[0024] When the distance between the object to be focused and the camera lens is greater than 3 meters, the number of parameter ranges is 2 M group, wherein M is a positive integer greater than or equal to 1, and M<6.

[0025] Before controlling the terminal to refocus based on the selected to-be-focused area, the focusing method further includes:

[0026] receiving a focus instruction voice, wherein the focus instruction voice includes voice information corresponding to the number of the area to be focused;

[0027] The terminal is controlled to refocus based on the selected area to be focused.

[0028] After controlling the terminal to refocus based on the selected area to be focused, the method includes:

[0029] When the terminal focus result image after refocusing still does not meet the preset conditions, keep the voice focus function of the terminal in an available state, re-execute the steps of opening the image preview interface, enabling the time-of-flight image sensor, acquiring the depth information of the image to be focused, and the subsequent steps;

[0030] When the terminal focusing result image after refocusing meets the preset condition, the time-of-flight image sensor is turned off.

[0031] Optionally, when the terminal focusing result image after refocusing meets a preset condition and the time-of-flight image sensor is turned off, the focusing method further includes:

[0032] A text message indicating successful focusing is provided on the image preview interface.

[0033] In a second aspect, a focusing device is provided, which is applicable to any one of the above-mentioned focusing methods, and the device comprises:

[0034] A condition determination unit, configured to control the terminal to enter a voice focus mode when the terminal focus result image does not meet a preset condition and the voice focus function of the terminal is in an available state;

[0035] An interface presentation unit, used for presenting an image preview interface;

[0036] A voice receiving unit, configured to receive a focus instruction voice, wherein the focus instruction voice includes voice information corresponding to the number of the area to be focused;

[0037] A control execution unit is used to control the terminal to refocus based on the selected to-be-focused area.

[0038] In a third aspect, a terminal is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the focusing method as described in any one of the foregoing when executing the computer program.

[0039] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the focusing method as described in any one of the above items is implemented.

[0040] It can be understood that the beneficial effects of the second, third and fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 is a flow chart of a focusing method provided in an embodiment of the present application;

[0043] Figure 2 is another flow chart of a focusing method provided by an embodiment of the present application;

[0044] Figure 3 is a structural schematic diagram of a focusing device provided in an embodiment of the present application;

[0045] Figure 4 It is a structural diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0047] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0048] In order to illustrate the technical solution of the present application, the following embodiments are used for illustration.

[0049] Embodiment 1

[0050] See also Figure 1 , an embodiment of the present application provides a focusing method, which may include the following steps 101-105.

[0051] Step 101: When the terminal focusing result image does not meet a preset condition and the voice focusing function of the terminal is in an available state, control the terminal to enter a voice focusing mode.

[0052] The focus result image is usually an image obtained by the terminal automatically focusing.

[0053] The above-mentioned preset conditions are usually pre-set conditions. In practice, the above-mentioned preset conditions may include but are not limited to at least one of the following first to fourth items.

[0054] The first item is that the focus area of ​​the focus result image is the area expected by the photographer. Here, when the focus result image does not meet the condition of the first item, it indicates that the focus area of ​​the focus result image is not the focus area expected by the photographer.

[0055] The second item is that the average pixel value of the area expected by the photographer in the focus result image is within the range of the preset pixel threshold. The preset pixel threshold is usually a preset pixel value, for example, it can be preset by the image processing module of the terminal image sensor. Here, when the focus result image does not meet the condition of the second item, it indicates that the focus area expected by the photographer in the focus result image is blurred.

[0056] The third item is that the average brightness of the pixels in the preset area in the focus result image is greater than or equal to the preset brightness value. The preset area is usually a preset area, such as a central area. The preset brightness value is usually a preset brightness value. Here, when the focus result image does not meet the condition of the third item, it indicates that the brightness of the preset area in the focus result image is insufficient.

[0057] The fourth item is that the autofocus time is greater than the preset time. The preset time is usually a pre-set time value, for example, the preset time may be 15 seconds. Here, when the photographer uses the autofocus function of the camera, if it exceeds 15 seconds, it is considered that the autofocus time is too long.

[0058] In this embodiment, the execution subject of the above focusing method is usually a terminal with a camera function, and specifically may be based on a controller in the terminal.

[0059] In practice, when the focus result image of the terminal does not meet the above preset conditions, the above execution subject can determine whether the voice focus function of the terminal is in an available state. If it is in an available state, the terminal is controlled to enter the voice focus mode. If it is not in an available state, the terminal is not controlled to enter the voice focus mode. In the voice focus mode, the terminal can receive the voice information input by the user and focus based on the voice input by the user.

[0060] In actual applications, the above-mentioned execution subject can obtain the value of the function parameter corresponding to the voice focus function. If the value of the function parameter is the first value used to indicate that the voice focus function is in an available state, it is determined that the voice focus function is in an available state. For example, the execution subject can obtain the user's voice command and control based on the control system according to the voice command to realize the focus function. Of course, it can also be other methods in the prior art to determine whether the voice focus function is in an available state; conversely, if the value of the function parameter is the second value used to indicate that the voice focus function is in an unavailable state, it is determined that the voice focus function is in an unavailable state.

[0061] In one embodiment, when the focus result image of the terminal does not meet the above preset conditions, the voice focus system is turned on to make the voice focus function available. For example, a voice focus function option can be added to the camera's control interface. After checking, the voice recognition system can be turned on when the auto focus is not ideal or the auto focus fails (when the focus result image does not meet the above preset conditions). For example, in a specific application, not meeting the preset conditions may be: when the human eye observes, the focused area in the entire picture is not what the photographer wants, and the area to be focused is blurred; or the lens has been performing a focus operation and the focus fails, and the voice focus mode is turned on at this time. In an optional example, the voice focus function can be in an available state by default after the voice recognition system is turned on.

[0062] Step S102: presenting an image preview interface, and enabling a time-of-flight image sensor to obtain depth information of the image to be focused.

[0063] It is understandable that the terminal may include at least one image preview interface, and the focus picture is displayed in at least one image preview interface. Among them, the time-of-flight image sensor is built into the terminal, and it can be an indirect time-of-flight image sensor (Indirect Timeofflightimagesensor) or a direct time-of-flight image sensor (DirectTimeofflightimagesensor). The former adopts a method of measuring phase shift, that is, the phase difference between the transmitted sine wave / square wave and the received sine wave / square wave; the latter is to transmit and receive N light signals within a single frame measurement time, and then make a histogram statistics of the recorded N flight times, where the flight time with the highest frequency is used to calculate the target distance. Compared with the latter, the former can achieve higher resolution, and because the principle is simpler and there is no need to set up an image processing module separately, it is easier to integrate into the terminal system. Therefore, in this embodiment, as a preferred implementation, the time-of-flight image sensor is an indirect time-of-flight image sensor.

[0064] By using a time-of-flight image sensor, a tiny emitter can be used to emit infrared light or laser, where the light generated will bounce off any object and return to the sensor, and the distance between the object and the sensor can be measured based on the time difference between the emission of the light and the time it is reflected by the object and returned to the sensor. Therefore, the object can be detected quickly and accurately in a short time, thereby more quickly obtaining the depth information of the image to be focused.

[0065] Step S103: clustering the depth information and setting the parameter range.

[0066] Since time-of-flight image sensors usually use tiny emitters to emit infrared light or lasers, the light generated will bounce off any object and return to the sensor. The distance between the object and the sensor is measured based on the time difference between the light emission and the light reflection from the object and the sensor. Therefore, the depth information received is usually presented in the form of discrete data. Each picture corresponds to different discrete forms of depth information, so it is difficult to divide the parameter range in a strict sense through artificial definition.

[0067] Based on this, the depth information of all pixels in the focused image can be clustered, and the result of the clustering process can be used as the result of the region division, that is, different clustering regions correspond to different depth regions, and the depth information of the central pixel in different clustering regions can be determined as the depth information of the depth region, so that a regular clustering point set corresponding to the depth information in the focused image can be obtained, and the range between the minimum and maximum values ​​in the clustering point set constitutes the parameter range. The embodiment of the present application does not specifically limit the method of clustering processing, which may vary according to different actual application scenarios.

[0068] Before this step is completed, the depth information map and the image to be focused can also be fused and calculated to obtain a depth image to be focused that overlaps with the depth information map. Figure 2 , the specific steps can be:

[0069] S1031: Storing the depth information map and the image to be focused in a storage unit;

[0070] It is understandable that the storage unit can be a memory in the terminal or a storage device set outside the terminal, and the embodiment of the present application does not limit this. The depth information map and the image to be focused are stored in the storage unit in different orders and called together when performing subsequent transformation matrix calculations.

[0071] S1032: Calculate the depth image according to pixels and the conversion matrix to obtain a depth image to be focused that overlaps with the image to be focused.

[0072] Among them, at different distances, the conversion relationship between the RGB image information corresponding to the image to be focused and the depth information is different, and the conversion relationship is related to the depth value in the depth information; the corresponding relationship between the RGB image information corresponding to the image to be focused and the depth information is calculated in real time according to the depth value of the center of the depth information obtained by the time-of-flight image sensor, that is, different conversion matrices are obtained at different depths; specifically, the calculation method of the pixel and the conversion matrix can be:

[0073] Since the depth image and the image to be focused, which are composed of several depth information, are presented through the image preview interface, two-dimensional coordinate systems can be established for the depth image and the image to be focused respectively. The corresponding position relationship and pixel points of the above two two-dimensional coordinate systems in the area range of the image preview interface are the same. In other words, any pixel point corresponds to a depth value representing the depth information (value range 0-1) and an RGB image value of the RGB image information (value range 0-255). Therefore, the above depth information and RGB image information can be described in the form of matrices respectively. Calculating the depth image according to pixels and the conversion matrix is ​​to convert the RGB image information and depth information corresponding to the image to be focused into a specific value that contains both the RGB image value of the RGB image information and the depth value representing the depth information in a linear operation manner. For example, the specific value is obtained by multiplying the two.

[0074] The specific value corresponds to both the RGB image value of the RGB image information and the depth value representing the depth information; when the image preview interface is presented, a three-dimensional coordinate system is formed on the image preview interface, wherein the first coordinate and the second coordinate correspond to the position of the pixel point obtained by the time-of-flight image sensor, respectively, and the third coordinate is used to represent the specific value of the RGB image value that contains both the RGB image information and the depth value representing the depth information. As a preferred embodiment, the specific value is obtained by multiplying the depth value and the RGB image value, the first coordinate and the second coordinate are the horizontal coordinate and the vertical coordinate of the corresponding image preview interface, and the third coordinate is the RGB color corresponding to the specific value of the corresponding pixel point. Since the depth value has a value range of 0-1 and the RGB image value has a value range of 0-255, the specific value obtained by multiplying the two is also in the range of 0-255, so the specific value can be represented by the RGB color.

[0075] In the embodiment of the present application, when the distance between the object to be focused and the camera lens is less than or equal to 3 meters, the number of parameter ranges is 2. N group, where N is a positive integer greater than or equal to 1, and 6≤N≤8;

[0076] When the distance between the object to be focused and the camera lens is greater than 3 meters, the number of parameter ranges is 2 M group, wherein M is a positive integer greater than or equal to 1, and M<6.

[0077] It is understandable that the focusing effect will vary greatly in different scenarios; for the close-up mode, that is, the distance from the object to be focused to the camera lens is less than or equal to 3 meters, usually, the above distance refers to the object distance between the focused object and the camera lens; when the image preview interface is presented, a three-dimensional coordinate system is formed on the image preview interface, wherein the first coordinate and the second coordinate correspond to the positions of the pixels obtained by the time-of-flight image sensor, respectively, and the third coordinate is used to represent a specific value of the RGB image value that contains both RGB image information and the depth value that represents the depth information. For example, in the preferred embodiment, the specific value can be represented by RGB color. Since the specific value needs to be based on the RGB image value, the maximum range of the parameter range to be set should be at most 256, that is, 2 8 Considering the close-up mode, that is, when the distance between the object to be focused and the camera lens is less than or equal to 3 meters, it is necessary to describe more details of the focused object. By focusing on a smaller range of pixels, the details can be more prominent. Therefore, the number of parameter ranges can be set to 2. N group, wherein N is a positive integer greater than or equal to 1, and 6≤N≤8, that is, the number of the aforementioned parameter ranges is at most 256 and at least 64.

[0078] Similarly, for the long-range mode, that is, when the distance between the object to be focused and the camera lens is greater than 3 meters, that is, when the distance between the object to be focused and the camera lens is greater than 3 meters and a more complete description of the image is required, the number of parameter ranges can be set to 2. M group, wherein M is a positive integer greater than or equal to 1, and M<6, that is, the number of the aforementioned parameter ranges is at most 32 and at least 2.

[0079] Step 104: Divide the image to be focused into a plurality of regions according to the parameter range to obtain a plurality of regions to be focused, and number the plurality of regions to be focused.

[0080] According to the parameter range defined above, the image to be focused can be divided into several areas. In other words, any area can enclose several discretely distributed depth information in a specific area, and enclose and display it with an unspecified curve in the image preview interface. The shape and size of each area in the image preview interface can be the same. In another application scenario, the shape and size of each area in the image preview interface can also be different. Since the depth information obtained by the time-of-flight image sensor is usually distributed in a discrete form, most of the areas in the image preview interface are irregular shapes.

[0081] The above-mentioned several regions may be numbered according to the size of the depth information, or may be numbered along the relative positions of the several regions in the horizontal-vertical direction in the image preview interface. The embodiment of the present application does not specifically limit the numbering method.

[0082] Step 105: select a number corresponding to any area to be focused by voice input, and control the terminal to refocus based on the selected area to be focused.

[0083] In this step, it is necessary to receive the focus instruction voice in advance, and the focus instruction voice includes voice information corresponding to the number of the area to be focused; then, according to the voice information, the control terminal refocuses based on the selected area to be focused. Among them, the focus instruction voice includes voice information corresponding to the area mark of the selected interface area. The selected interface area can be any interface area in the image preview interface. If the selected interface area is area 1, the focus instruction voice can be implemented as "Please focus on area 1" or "Please focus on the number 1 area".

[0084] Here, the user can send a focus instruction voice to the terminal based on the image preview interface. The terminal can receive the focus instruction voice through its own voice receiving device, such as a microphone.

[0085] Here, in the voice focus mode, the terminal can present an image preview interface including multiple areas, each area corresponds to an area mark, which is convenient for distinguishing the areas, helps the user to quickly select the area they want to focus on based on the area mark of the area, and helps the terminal to quickly focus based on the area selected by the user, thereby improving the focusing efficiency.

[0086] The terminal may use the area information of the selected area to be focused to generate a focus instruction, and control the terminal to refocus through the focus instruction.

[0087] In some application scenarios, the focusing method of the terminal to obtain the above-mentioned focusing result image may be the same as or different from the focusing method based on the selected interface area. As an example, the focusing method of the terminal to obtain the above-mentioned focusing result image may be phase focus (Phase Detection Auto Focus, PDAF), and the focusing method based on the selected interface area may be contrast focus. Of course, other methods may also be used to perform secondary focusing based on the selected interface area to improve focusing accuracy.

[0088] In an embodiment of the present application, after the control terminal refocuses based on the selected to-be-focused area, the method includes:

[0089] When the terminal focus result image after refocusing still does not meet the preset conditions, keep the voice focus function of the terminal in an available state, re-execute opening the image preview interface, and enable the time-of-flight image sensor to obtain the depth information of the image to be focused and the subsequent steps, that is, re-perform S102 and the subsequent operations. Considering that in this state, the image preview interface remains open and the time-of-flight image sensor remains enabled, if the focus operation is not terminated, it is only necessary to wait for the terminal to re-acquire the depth information of the image to be focused;

[0090] When the terminal focus result image after refocusing meets the preset conditions, that is, the focus area of ​​the focus result image is the area expected by the photographer, the average pixel value of the area expected by the photographer in the focus result image is within the preset pixel threshold range, the average brightness of the pixels in the preset area in the focus result image is greater than or equal to the preset brightness value, and the autofocus time is greater than the preset duration, the time-of-flight image sensor is turned off.

[0091] In some optional implementations of this embodiment, before the control terminal refocuses based on the selected focus area, the focusing method may also include: presenting a preset control interface, and if a function activation operation for the preset control interface is detected, setting the voice focus function of the terminal to an available state.

[0092] Among them, the above-mentioned preset control interface is usually a pre-set interface. The above-mentioned function activation operation is usually an operation for confirming the activation of the voice focus function. In practice, the function activation operation can be implemented by setting the switch button of the voice focus function to "activate" or "ON". Users can decide whether to enable the voice focus function by themselves, which can improve the user experience.

[0093] In some optional implementations of this embodiment, when the terminal focus result image after refocusing meets the preset conditions and the time-of-flight image sensor is turned off, the focusing method further includes: providing text information indicating successful focusing on the image preview interface. In practice, after the refocusing is successful, the user can be prompted to successfully focus in the image preview section by means of a pop-up window. For example, the text information indicating successful focusing can be "Focus successful" or other feasible text information prompts. Users can decide whether to turn on the text message reminder function, thereby effectively improving the user experience.

[0094] The focusing method provided in this embodiment, when the automatic focusing result of the terminal is not ideal, controls the terminal to enter the voice focusing mode, so that the user can select the user's desired focus area from the image preview interface by voice, and can implement focusing based on the user's desired focus area, which helps to improve the user experience. In addition, by introducing a time-of-flight image sensor, a tiny emitter is used to emit infrared light or laser, and the generated light will bounce off any object and return to the sensor. The distance between the object and the sensor is measured according to the time difference between the emission of the light and the light reflected by the object and returned to the sensor, and the depth information of the object to be focused is obtained. The parameter range of the corresponding image screen is divided by clustering processing and presented on the image preview interface. The user can obtain the desired focus area under the prompt of the depth information and select the desired focus area as the area to be focused. The above method helps to improve the focusing efficiency.

[0095] Embodiment 2

[0096] Corresponding to the focusing method of the first embodiment, the present application provides a focusing device. Specifically, Figure 3 2 shows a structural block diagram of a focusing device 200 provided in an embodiment of the present application. For the sake of convenience, only the parts related to the embodiment of the present application are shown. Figure 3 The focusing device includes a condition determination unit 201, an interface presentation unit 202, a voice receiving unit 203 and a control execution unit 204. Among them:

[0097] The condition determination unit 201 is used to control the terminal to enter a voice focus mode when the terminal focus result image does not meet a preset condition and the voice focus function of the terminal is in an available state;

[0098] The interface presenting unit 202 is used to present an image preview interface;

[0099] A voice receiving unit 203, configured to receive a focus instruction voice, wherein the focus instruction voice includes voice information corresponding to the number of the area to be focused;

[0100] The control execution unit 204 is used to control the terminal to refocus based on the selected to-be-focused area.

[0101] In some embodiments, the focusing device includes a storage unit for storing the depth information map and the image to be focused obtained by the time-of-flight image sensor; the storage unit can be a memory in the terminal, or a storage device set separately outside the terminal, which is not limited in the embodiments of the present application. The depth information map and the image to be focused are stored in the storage unit in different orders, and are called together when performing subsequent transformation matrix calculations.

[0102] In some embodiments, the focusing device further includes a computing unit for clustering the depth information and setting the parameter range. The depth information of all pixels in the image to be focused can be clustered, and the result of the clustering process can be used as the result of the region division, that is, different cluster regions correspond to different depth regions, and the depth information of the central pixel in different cluster regions can be determined as the depth information of the depth region, so that a regular cluster point set corresponding to the depth information in the image to be focused can be obtained, and the range between the minimum value and the maximum value in the cluster point set constitutes the parameter range.

[0103] In some embodiments, the focusing device further includes a screen division unit for dividing the image to be focused into several areas according to the parameter range to obtain several areas to be focused, and numbering the several areas to be focused. The image to be focused can be divided into several areas according to the parameter range defined above. In other words, the screen division unit can circle several discretely distributed depth information in a specific area, and circle and display it with an unspecified curve in the image preview interface. The shape and size of each area in the image preview interface may be the same. In another application scenario, the shape and size of each area in the image preview interface may also be different. Since the depth information obtained by the time-of-flight image sensor is usually distributed in a discrete form, most of the areas in the image preview interface are irregular shapes. The aforementioned screen division unit can be used to number the above-mentioned several areas by the size of the depth information, or it can be numbered along the relative position of several areas in the horizontal-vertical direction in the image preview interface.

[0104] In some embodiments, the focusing device further includes a state jump unit, which is used to timely change the working state and process of the terminal when the refocusing meets the preset conditions or does not meet the preset conditions.

[0105] In some embodiments, the focusing device further includes a state setting unit for presenting a preset control interface. If a function activation operation for the preset control interface is detected, the voice focusing function of the terminal is set to an available state.

[0106] The present embodiment provides a focusing device. When the automatic focusing result of the terminal is not ideal, by controlling the terminal to enter the voice focusing mode, the user can select the focus area desired by the user from the image preview interface by voice, and focusing can be performed based on the focus area desired by the user, which helps to improve the user experience. In addition, since the image information corresponding to the selected interface area is usually much less than the image information of the entire image, focusing based on the selected interface area can avoid interference from unnecessary information in other interface areas, which helps to improve the success rate of focusing, thereby improving the focusing efficiency.

[0107] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the embodiment of the method of the present application, and their specific functions and technical effects can be specifically referred to in the embodiment corresponding to the focusing method, and will not be repeated here. The above-mentioned focusing device can be a device with a shooting and focusing function such as a camera, a mobile phone, and a tablet computer, and can perform shooting and focusing based on a CMOS image sensor.

[0108] Embodiment 3

[0109] Corresponding to the focusing method and focusing device of the first embodiment, the present application provides a terminal. Specifically, Figure 4 FIG. 3 is a schematic diagram of the structure of a terminal 300 provided in an embodiment of the present application. Figure 4 As shown, the terminal 300 of this embodiment includes: at least one processor 301 ( Figure 4 Only one processor is shown in the figure), a memory 302, and a computer program 303 stored in the memory 302 and executable on at least one processor 301, such as a program corresponding to a focusing method. When the processor 301 executes the computer program 303, the steps in any of the above-mentioned focusing method embodiments are implemented. When the processor 301 executes the computer program 303, the steps in the above-mentioned focusing method embodiments are implemented. When the processor 301 executes the computer program 303, the functions of each module / unit in the above-mentioned focusing device embodiments are implemented, such as Figure 3 The functions of the condition determination unit 201, the interface presentation unit 202, the voice receiving unit 203 and the control execution unit 204 are shown. The terminal can be a terminal with a shooting and focusing function such as a camera, a mobile phone, or a tablet computer, and can perform shooting and focusing based on a CMOS image sensor.

[0110] Exemplarily, the computer program 303 may be divided into one or more modules / units, one or more modules / units are stored in the memory 302, and are executed by the processor 301 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 303 in the terminal 300. For example, the computer program 303 may be divided into a condition determination unit, an interface presentation unit, a voice receiving unit, and a control execution unit. The specific functions of each unit have been described in the above embodiments and will not be repeated here.

[0111] The terminal 300 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 4It is only an example of terminal 300 and does not constitute a limitation of terminal 300. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal may also include input and output devices, network access devices, buses, etc.

[0112] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0113] The memory 302 may be an internal storage unit of the terminal 300, such as a hard disk or memory of the terminal 300. The memory 302 may also be an external storage device of the terminal 300, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal 300. Further, the memory 302 may also include both an internal storage unit of the terminal 300 and an external storage device. The memory 302 is used to store computer programs and other programs and data required by the terminal. The memory 302 may also be used to temporarily store data that has been output or is to be output.

[0114] Embodiment 4

[0115] The present application also provides a computer-readable storage medium. Specifically, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0116] If the integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium can be non-volatile or volatile. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in computer-readable storage media can be appropriately increased or decreased according to the requirements of legislation and patent practices in the jurisdiction. For example, in some jurisdictions, based on legislation and patent practices, computer-readable storage media do not include electrical carrier signals and telecommunication signals.

[0117] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A focusing method, characterized in that: The focusing method comprises: When the terminal focus result image does not meet the preset condition and the voice focus function of the terminal is in an available state, controlling the terminal to enter the voice focus mode; Presenting an image preview interface and enabling a time-of-flight image sensor to obtain depth information of the image to be focused; Performing clustering processing on the depth information and setting a parameter range; Dividing the to-be-focused image into a plurality of regions according to the parameter range to obtain a plurality of the to-be-focused regions, and numbering the plurality of the to-be-focused regions; The voice input selects the number corresponding to any of the areas to be focused, and controls the terminal to refocus based on the selected area to be focused.

2. The focusing method according to claim 1, characterized in that: Before dividing the image to be focused into a plurality of regions according to the parameter range to obtain a plurality of the regions to be focused, the focusing method further includes: A fusion calculation is performed on the depth information map and the image to be focused to obtain a depth image to be focused that overlaps with the depth information map.

3. The focusing method according to claim 2, characterized in that: When performing fusion calculation on the depth information map and the image to be focused, the focusing method further includes: Storing the depth information map and the image to be focused in a storage unit; The depth image is calculated according to pixels and a conversion matrix to obtain a depth image to be focused that overlaps with the image to be focused.

4. The focusing method according to claim 1, characterized in that: Before controlling the terminal to enter the voice focus mode, the focusing method further includes: A preset control interface is presented, and if a function activation operation for the preset control interface is detected, the voice focus function of the terminal is set to an available state.

5. The focusing method according to claim 1, characterized in that: When the terminal focus result image does not meet a preset condition and the voice focus function of the terminal is in an available state, control the terminal to enter a voice focus mode, wherein the preset condition includes at least one of the following: The focus area of ​​the focus result image is the area expected by the photographer, the average pixel value of the area expected by the photographer in the focus result image is within the preset pixel threshold range, the average brightness of the pixels in the preset area in the focus result image is greater than or equal to the preset brightness value, and the autofocus time is greater than the preset duration.

6. The focusing method according to claim 1, characterized in that: After clustering the depth information and setting the parameter range, the focusing method further includes: When the distance between the object to be focused and the camera lens is less than or equal to 3 meters, the number of parameter ranges is 2 N group, where N is a positive integer greater than or equal to 1, and 6≤N≤8; When the distance between the object to be focused and the camera lens is greater than 3 meters, the number of parameter ranges is 2 M group, wherein M is a positive integer greater than or equal to 1, and M<6.

7. The focusing method according to claim 1, characterized in that: Before controlling the terminal to refocus based on the selected to-be-focused area, the focusing method further includes: receiving a focus instruction voice, wherein the focus instruction voice includes voice information corresponding to the number of the area to be focused; The terminal is controlled to refocus based on the selected area to be focused.

8. The focusing method according to claim 1, characterized in that: After controlling the terminal to refocus based on the selected area to be focused, the method includes: When the terminal focus result image after refocusing still does not meet the preset conditions, keep the voice focus function of the terminal in an available state, re-execute the steps of opening the image preview interface, enabling the time-of-flight image sensor, acquiring the depth information of the image to be focused, and the subsequent steps; When the terminal focusing result image after refocusing meets the preset condition, the time-of-flight image sensor is turned off.

9. The focusing method according to claim 8, characterized in that: When the terminal focusing result image after refocusing meets the preset condition and the time-of-flight image sensor is turned off, the focusing method further includes: A text message indicating successful focusing is provided on the image preview interface.

10. A focusing device, adapted to execute the focusing method according to any one of claims 1 to 9, characterized in that: The device comprises: A condition determination unit, configured to control the terminal to enter a voice focus mode when the terminal focus result image does not meet a preset condition and the voice focus function of the terminal is in an available state; An interface presentation unit, used for presenting an image preview interface; A voice receiving unit, configured to receive a focus instruction voice, wherein the focus instruction voice includes voice information corresponding to the number of the area to be focused; A control execution unit is used to control the terminal to refocus based on the selected to-be-focused area.

11. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the focusing method according to any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the focusing method according to any one of claims 1 to 9 is implemented.