WO2016197494A1 - 对焦区域调整方法和装置 - Google Patents

对焦区域调整方法和装置 Download PDF

Info

Publication number
WO2016197494A1
WO2016197494A1 PCT/CN2015/091763 CN2015091763W WO2016197494A1 WO 2016197494 A1 WO2016197494 A1 WO 2016197494A1 CN 2015091763 W CN2015091763 W CN 2015091763W WO 2016197494 A1 WO2016197494 A1 WO 2016197494A1
Authority
WO
WIPO (PCT)
Prior art keywords
focus area
depth
field
size
depth information
Prior art date
Application number
PCT/CN2015/091763
Other languages
English (en)
French (fr)
Inventor
胡文迪
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016197494A1 publication Critical patent/WO2016197494A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G03PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
    • G03BAPPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
    • G03B13/00Viewfinders; Focusing aids for cameras; Means for focusing for cameras; Autofocus systems for cameras
    • G03B13/32Means for focusing
    • G03B13/34Power focusing
    • G03B13/36Autofocus systems

Definitions

  • This document relates to, but is not limited to, the field of photographing, and in particular to a method and apparatus for adjusting a focus area.
  • the embodiment of the invention provides a method and a device for adjusting a focus area, which aims to solve the technical problem that the adjustment is not accurate when the focus area is manually adjusted during the photographing process.
  • a method for adjusting a focus area includes the following steps:
  • the resized area is used as the current focus area.
  • the step of adjusting the size of the focus area according to the acquired depth information includes:
  • the method further includes: after the step of comparing the depth of field mean square difference value with a preset threshold value,
  • the size of the focus area is kept unchanged.
  • the step of adjusting the size of the focus area according to the acquired depth information includes:
  • the focus area is adjusted according to the acquired size.
  • the focus area adjustment method further includes: before the step of acquiring the depth information corresponding to the current focus area,
  • an embodiment of the present invention further provides a focus area adjustment apparatus, where the focus area adjustment apparatus includes:
  • an adjustment module configured to adjust a size of the focus area according to the obtained depth information
  • the processing module is configured to set the resized area as the current focus area.
  • the adjusting module includes:
  • a calculating unit configured to calculate a pixel in the current focus area according to the acquired depth information a depth of field mean value of the point; after the first acquiring unit acquires the depth of field information, continuing to calculate the depth of field mean square value of the pixel in the reduced focus area according to the obtained depth information, the ratio And the unit continues to compare the depth of field mean square value with a preset threshold until the depth of field of the pixel in the reduced focus area is less than or equal to the threshold;
  • Aligning unit configured to compare the depth of field deviation value with a preset threshold
  • a reducing unit configured to reduce the size of the focus area by a preset ratio when the depth of field mean square difference is greater than the threshold
  • the first acquiring unit is configured to acquire depth information of the reduced focus area.
  • the adjusting module further includes:
  • the holding unit is configured to keep the size of the focus area unchanged when the depth of field mean value is less than or equal to the threshold.
  • the adjusting module further includes:
  • a determining unit configured to determine an average depth value of the pixel points in the focus area according to the acquired depth information
  • a second acquiring unit configured to acquire a size of the focus area corresponding to the determined depth of field mean value based on a mapping relationship between the preset depth of field mean value and the size of the focus area;
  • the adjustment unit is configured to adjust the focus area according to the acquired size.
  • the focus area adjustment device further includes:
  • a judging module configured to determine a current lighting mode
  • the processing module is further configured to acquire a preset focus area according to the illumination mode, and use the acquired focus area as a current focus area.
  • an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing method.
  • the focus area adjustment method and device may first acquire the depth information corresponding to the current focus area during the photographing process, and then adjust the pair according to the obtained depth information.
  • the size of the focal region is adjusted according to the adjusted focus area, and the size of the focus area is adjusted by the acquired depth information. As the depth information changes, the size of the focus area is adjusted accordingly.
  • the size of the focus area is not adjusted by manual adjustment, which improves the accuracy of the focus area adjustment.
  • FIG. 1 is a schematic flow chart of a focus area adjustment method according to a first embodiment of the present invention
  • FIG. 2 is a schematic flow chart of the refinement of the first embodiment of step S20 of FIG. 1;
  • step S20 in FIG. 1 is a schematic diagram showing a refinement process of the second embodiment of step S20 in FIG. 1;
  • step S20 of FIG. 1 is a schematic flow chart of a third embodiment of step S20 of FIG. 1;
  • FIG. 5 is a schematic diagram of functional modules of a focus area adjusting device according to a first embodiment of the present invention
  • FIG. 6 is a schematic diagram of a refinement function module of the first embodiment of the adjustment module 20 of FIG. 5;
  • FIG. 7 is a schematic diagram of a refinement function module of the second embodiment of the adjustment module 20 of FIG. 5;
  • FIG. 8 is a schematic diagram of a refinement function module of the second embodiment of the adjustment module 20 of FIG. 5.
  • Embodiments of the present invention provide a focus area adjustment method.
  • FIG. 1 is a schematic flow chart of a method for adjusting a focus area according to a first embodiment of the present invention.
  • the embodiment provides a focus area adjustment method, where the focus area adjustment method includes:
  • Step S10 acquiring depth information corresponding to the current focus area
  • the step of acquiring the current focus area includes:
  • the preset focus area is obtained as the current focus area, such as the end
  • the center position of the camera interface is used as the preset focus area.
  • the center position of the camera interface is used as the current focus area.
  • the focus area is selected according to the touch operation input by the user, that is, the terminal displays the photographing interface.
  • the user touches any area of the photographing interface the area touched by the user is used as the current focus area.
  • the focus area of the previous moment is taken as the current focus area.
  • the manner of acquiring the depth information corresponding to the current focus area includes:
  • Method 1 During the photographing process, the focus area is focused by the binocular camera preset by the terminal to obtain the depth information of the focus area. It can be understood that the distance between the binocular cameras Is a certain (such as 2mm), when using the binocular camera to focus on the focus area, the angle difference between the binocular camera and the focus scene can be obtained, and then the depth of field information can be calculated by a preset calculation formula such as a sine theorem . The subject is focused by the binocular camera, and the average value of the depth information of the two cameras is calculated, so that the obtained depth information is more accurate.
  • a certain such as 2mm
  • the terminal analyzes which pixel has a higher degree of reduction on the scene, and selects a pixel with higher degree of reduction, which can effectively suppress the interference of the noise, so that the two small lenses can be obtained. Similar to the effect of a large lens, there is less noise and more precise depth information.
  • Method 2 When focusing on the scene corresponding to the focus area, the infrared signal is first transmitted by the infrared sensor preset by the terminal, then the reflected light of the object in front is received, and the depth information is obtained by a preset calculation formula, for example, infrared When the sensor sends infrared light, it will emit light when it encounters the object. By calculating the time of the reflected light reflected by the scene and the speed of the light, the depth of field information of the focus scene is calculated.
  • a preset calculation formula for example, infrared
  • Method 3 First identify the scene corresponding to the focus area in the photo screen, and then according to the preset scene The object mode selects the scene mode corresponding to the scene corresponding to the focus area. After the confirmation is completed, according to the depth information mapped by the preset scene mode, the approximate distance between the scene corresponding to the focus area and the camera is determined, and then passes through the binocular camera or infrared. The sensor gets accurate depth of field information.
  • Step S20 adjusting a size of the focus area according to the obtained depth information
  • step S20 includes:
  • the step S20 includes:
  • Step S21 calculating a depth-of-field variance value of a pixel point in the current focus area according to the acquired depth-of-field information
  • Step S22 comparing the depth of field mean square difference value with a preset threshold value
  • Step S23 when the depth of field mean square difference is greater than the threshold, reducing the size of the focus area by a preset ratio
  • Step S24 acquiring depth information of the reduced focus area, and continuing to perform steps S21 and S22 until the depth of field of the pixel in the reduced focus area is less than or equal to the threshold.
  • the preset threshold THx may be set according to two modes: a normal illumination mode and a dim light mode.
  • the preset threshold THx may be: the depth of field t is: When the depth of the distance t is 30cm to 50cm, the preset threshold is Th2; when the depth of field t is 50cm ⁇ 1m, the preset threshold is Th3.
  • the threshold is preset. It should be noted that the principle of Thx setting is that the closer the camera distance is, the smaller the depth of field distance is, the smaller the Thx value is, and the difference between the dark light mode and the normal light mode respectively. Adjustable.
  • an alternative is to first determine a depth value of each pixel in the focus area, and then calculate an average value according to each pixel point, and finally calculate a depth of field of the pixel in the focus area.
  • the square difference value Ms (mean square) is used to compare the mean depth value of the depth of field with a preset threshold. When the depth of field mean value Ms is greater than the preset threshold Thx, different focal planes exist at this time. The object is in the focus area, causing the focus to be inconspicuous.
  • the terminal is centered on the focus in the focus area, and the size of the focus area is reduced according to a preset manner, such as reducing the size of the focus area according to a preset ratio (10%), and reducing the back focus area.
  • the depth of field mean value of the pixel is compared with a preset threshold. If the depth of field deviation is still greater than the preset threshold, the size of the focus area is continuously reduced according to a preset manner until The depth of field deviation of the pixel points in the reduced focus area is less than or equal to the preset threshold. It can be understood that when the depth of field of the pixel points in the focus area is less than or equal to the preset threshold. At this time, the scene in the focus area is a scene at the same focal plane, which makes the focus more accurate.
  • the depth of field information is first acquired by a binocular camera or an infrared sensor, and then the depth of field deviation of the pixel points in the focus area is calculated according to the depth information, and the depth of field deviation and the preset threshold are performed.
  • the comparison dynamically adjusts the size of the focus area according to the comparison result, so that when shooting a macro object, the size of the focus area can be more accurately obtained, so as to prevent objects of different focal planes from entering the focus area, and according to the adjusted focus.
  • the area focuses on the subject. After the adjustment, the focus of different depth information will not enter the focus area when the focus area is too large, causing the focus error. Instead, the size of the focus area is adjusted by the depth information to make the focus area
  • the scene is a scene on a focal plane that improves the accuracy of the focus during the photo session.
  • step S20 further includes:
  • Step S25 When the depth of field mean value is less than or equal to the threshold, the size of the focus area is kept unchanged.
  • the mean depth value of the depth of field when the mean depth value of the depth of field is less than or equal to the preset threshold, it indicates that the focus range of the focus area is not greater than the preset range of the focus scene, and the focus is not blurred, resulting in The focus is not clear; at the same time, the focus range is not smaller than the preset range of the focus subject, reducing the noise interference, keeping the size of the focus area unchanged.
  • the step S30 includes:
  • Step S26 determining, according to the obtained depth information, the depth of field of the pixel in the focus area;
  • Step S27 Acquire a size of the focus area corresponding to the determined depth of field mean value based on a mapping relationship between the preset depth of field mean value and the size of the focus area;
  • Step S28 adjusting the focus area according to the acquired size.
  • the correspondence between the mean value of the depth of field and the focus area is summarized.
  • the depth of field of the pixel in the focus area is calculated first, that is, the depth of field value of each pixel in the focus area is calculated, and then the average value of each pixel is averaged, and the mean value of the depth of field is determined according to the mean value of the depth of field.
  • Corresponding focus area value, and adjust the focus area of the screen to the focus area value corresponding to the preset depth of field mean, for example, when the depth information is 20 to 30 cm, the focus area is adjusted to 1/8 of the length and width of the photographed picture; When the depth of field information is 30 to 50 cm, the focus area value is adjusted to 1/7 of the length and width of the screen, that is, the focus area size is adjusted in real time according to the depth of field information. It can be understood that the mapping relationship between the average depth of field and the focus area is analyzed according to multiple test results, and may be set to other values according to specific needs. It can be understood that when the acquired size and the focus area are suitable and no adjustment is needed, the focus area may not respond to the adjustment instruction at this time, or after the size is adjusted, the focus area size is kept unchanged.
  • the depth of field of the scene with different focal planes can be recognized.
  • the scene in the foreground occupies a large area of the focus area
  • the scene in the background occupies the focus.
  • the area of the area is small.
  • the pixels of the scene in the background can be removed, and only the pixels of the foreground scene are retained.
  • step S30 the resized area is used as the current focus area.
  • the depth of field information corresponding to the current focus area may be acquired first, and then the size of the focus area is adjusted according to the obtained depth information, and the focus is adjusted according to the adjusted
  • the area focuses on the photographed object, and the size of the focus area is adjusted by the acquired depth information.
  • the size of the focus area is adjusted accordingly, instead of manually adjusting the size of the focus area to improve the size of the focus area.
  • the second embodiment of the focus area adjustment method of the present application is proposed based on the first embodiment.
  • the focus area adjustment method is provided before the step S10. Also includes the steps:
  • the illumination mode may include a normal illumination mode and a dim illumination mode.
  • the focus area may be preset to a default value; when the terminal is in the dim illumination mode, The increase can be made based on the default value of the focus area, which makes the focus area larger, which makes the focus effect more accurate.
  • the embodiment for acquiring the focus area according to the illumination mode includes: 1) if the current illumination mode of the terminal is the normal illumination mode, the focus area can be preset to 1/4 (adjustable) of the length and width of the screen; 2) If the current illumination mode of the terminal is the dim illumination mode, the focus area can be increased based on the focus area corresponding to the normal illumination mode, for example, the focus area corresponding to the dim illumination mode is set to 1/2 of the length and width of the picture ( Adjustable), equivalent to 1/4 of normal illumination plus 1/4, larger than the normal illumination focus area. It can be understood that in the dark light illumination mode, the focus area is enlarged, and the amount of light entering the focus area can be increased. At this time, the scene in the dark light illumination mode can be more accurately focused.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the above method.
  • the embodiment of the invention further provides a focus area adjusting device.
  • FIG. 5 is a schematic diagram of functional modules of a focus area adjusting device according to a first embodiment of the present invention.
  • the functional block diagram shown in FIG. 5 is merely an example diagram, and those skilled in the art can easily perform new functions around the functional modules of the focus area adjusting device shown in FIG. 5.
  • the function module is supplemented; the name of each function module is a custom name, which is only used to assist in understanding each program function block of the focus area adjusting device, and is not used to define the technical solution of the present application.
  • the embodiment provides a focus area adjustment apparatus, where the focus area adjustment apparatus includes:
  • the acquiring module 10 is configured to acquire depth information corresponding to the current focus area
  • the acquiring module 10 is further configured to acquire a current focus area, and the acquiring The manner in which module 10 obtains the current focus area includes:
  • the acquiring module 10 is configured to acquire a preset focus area as a current focus area. If the center position of the camera interface is used as a preset focus area by default, when the camera is in focus, The center position of the photo interface is used as the current focus area.
  • the focus area is selected according to the touch operation input by the user, that is, the photographing interface is displayed first.
  • the obtaining module 10 is set to use the area selected by the user as the current focus. region.
  • the acquisition module 10 is configured to use the focus area of the previous moment as the current focus area.
  • the manner in which the acquiring module 10 acquires the depth information corresponding to the current focus area includes:
  • Method 1 During the photographing process, the acquiring module 10 is configured to focus the focus area by using a preset binocular camera to obtain depth of field information of the focus area. It can be understood that the double The distance between the cameras is constant.
  • the acquiring module 10 is configured to obtain an angle difference between the binocular camera and the focus scene, and then adopt a preset calculation formula.
  • the depth of field information can be calculated as the sine theorem. The subject is focused by the binocular camera, and the average value of the depth information of the two cameras is calculated, so that the obtained depth information is more accurate.
  • the corresponding pixels in the binocular camera when the corresponding pixels in the binocular camera appear in pairs, it can be analyzed first which pixel has a higher degree of reduction on the scene, and the pixel with higher degree of reduction can effectively suppress the interference of the noise, so that the two small lenses can Get a similar shot with a larger lens, less noise, and more precise depth of field information.
  • Method 2 When focusing on the scene corresponding to the focus area, the acquiring module 10 is configured to first transmit an infrared signal through the infrared sensor preset by the terminal, and then receive the reflection of the object in front. Light, and obtain the depth of field information through a preset calculation formula. For example, when the infrared sensor sends infrared light, the object will emit light, and the time of the reflected light reflected by the focused object and the speed of the light can be calculated to calculate the focus scene. Depth of field information.
  • Method 3 Firstly identify the scene corresponding to the focus area in the photographing picture, and then select the corresponding scene mode corresponding to the scene corresponding to the focus area according to the preset scene mode, and after confirming, determine according to the depth information of the preset scene mode mapping.
  • the approximate distance between the scene corresponding to the focus area and the camera, and then the acquisition module 10 is configured to obtain accurate depth of field information through the binocular camera or the infrared sensor.
  • the adjusting module 20 is configured to adjust a size of the focus area according to the obtained depth information
  • the adjusting module 20 is configured to adjust the focus area according to the acquired depth information:
  • the adjustment module 20 includes:
  • the calculating unit 21 is configured to calculate a depth of field mean value of the pixel points in the current focus area according to the obtained depth information;
  • the comparison unit 22 is configured to compare the depth of field deviation value with a preset threshold
  • the reducing unit 23 is configured to reduce the size of the focus area by a preset ratio when the depth of field mean square difference is greater than the threshold;
  • the first obtaining unit 24 is configured to acquire depth information of the focus area after the reduced size is obtained;
  • the calculating unit 21 is further configured to continue to calculate a depth of field mean value of the pixel points in the reduced focus area according to the obtained depth information
  • the comparing unit 22 is further configured to continue to compare the depth of field The variance value and the preset threshold until the depth of field deviation of the pixel points in the reduced focus area is less than or equal to the threshold.
  • the preset threshold THx may be set according to two modes: a normal illumination mode and a dim light mode.
  • the preset threshold THx may be: the depth of field t is: When the temperature is 20cm ⁇ 30cm, the preset threshold is Th1; when the depth of field t is 30cm ⁇ 50cm The preset threshold is Th2; when the depth of field t is 50 cm to 1 m, the preset threshold is Th3.
  • the threshold is preset. It should be noted that the principle of Thx setting is that the closer the camera distance is, the smaller the depth of field distance is, the smaller the Thx value is, and the difference between the dark light mode and the normal light mode respectively. Adjustable.
  • an optional method is: first determining a depth value of each pixel in the focus area, and then the calculating unit 21 is configured to calculate an average value according to each pixel point, and finally calculate the focus.
  • the depth of field mean value of the pixel points in the area is Ms (mean square)
  • the comparing unit 22 is configured to compare the mean squared difference value of the depth of field with a preset threshold value, when the depth of field mean square difference value Ms is greater than When the preset threshold Thx is at this time, the object having different focal planes is in the focus area, and the focusing effect is not obvious.
  • the alternative is: focusing on the focus in the focus area,
  • the reducing unit 23 is arranged to reduce the size of the in-focus area in a preset manner, such as reducing the size of the in-focus area according to a preset ratio (10%), and then the matching unit 22 is set to reduce the focus after focusing
  • the depth of field deviation of the pixel points in the area is compared with a preset threshold. If the depth of field deviation is still greater than the preset threshold, the comparison unit 22 is configured to continue according to a preset manner.
  • the focus area ruler Reducing the focus area ruler Until the depth of field deviation of the pixel points in the reduced focus area is less than or equal to the preset threshold, it may be understood that when the depth of field of the pixel points in the focus area is less than or equal to the preset At the threshold, the scene in the focus area is the scene at the same focal plane, making the focus more accurate.
  • the acquiring module 10 is configured to first acquire depth of field information through a binocular camera or an infrared sensor, and then the calculating unit 21 is configured to calculate the depth of field of the pixel in the focus area according to the depth of field information.
  • the mean square error is configured to compare the mean square error of the depth of field with a preset threshold, and dynamically adjust the size of the focus area according to the comparison result, so as to obtain a more accurate focus area when shooting a macro object.
  • the size is to prevent objects of different focal planes from entering the focus area, and focus on the photographed object according to the adjusted focus area. After the adjustment, the scenes with different depth information will not enter the focus area when the focus area is too large.
  • the size of the focus area is adjusted by the depth of field information, so that the scene in the focus area is a scene on a focal plane, which improves the accuracy of focusing during photographing.
  • the acquiring module 10 is configured to first acquire depth information by using a binocular camera or an infrared sensor, and then the calculating unit 21 in the adjusting module 20 is configured to calculate a focusing area according to the depth information.
  • the depth of field of the pixel points is squared, and the mean square error of the depth of field is compared with a preset threshold, and the size of the focus area is dynamically adjusted according to the comparison result, so that the size of the focus area can be more accurately obtained when shooting a macro object. This makes the focus more accurate.
  • the adjustment module 20 further includes:
  • the holding unit 25 is configured to keep the size of the focus area unchanged when the depth of field mean value is less than or equal to the threshold.
  • the holding unit 25 keeps the size of the focus area unchanged.
  • the adjustment module 20 further includes:
  • the determining unit 26 is configured to determine a depth of field mean value of the pixel point in the focus area according to the obtained depth information
  • the second acquiring unit 27 is configured to acquire, according to a mapping relationship between the preset depth of field mean value and the size of the focus area, a size of the focus area corresponding to the determined depth of field mean value;
  • the adjusting unit 28 is configured to adjust the focus area according to the acquired size.
  • the determining unit 26 is configured to first calculate the depth of field of the pixel in the focus area, that is, calculate the depth of field value of each pixel in the focus area, and then average each pixel point, and
  • the second acquiring unit 27 is configured to determine a corresponding focus area value according to the depth of field mean value
  • the adjusting unit 28 is configured to adjust a focus area of the screen to a focus area value corresponding to a preset depth of field mean, for example: When the depth of field information is 20 to 30 cm, the focus area is adjusted to 1/8 of the length and width of the photographed picture; when the depth of field information is 30 to 50 cm, the focus area value is adjusted to 1/7 of the length and width of the picture, that is, according to the depth of field information in real time.
  • Adjust the focus area size It can be understood that the mapping relationship between the average depth of field and the focus area is analyzed according to multiple test results, and may be set to other values according to specific needs. It can be understood that when the acquired size and the focus area are suitable and no adjustment is needed, the focus area may not respond to the adjustment instruction at this time, or after the size is adjusted, the focus area size is kept unchanged.
  • the depth of field of the scene with different focal planes can be recognized.
  • the scene in the foreground occupies a large area of the focus area
  • the scene in the background occupies the focus.
  • the area of the area is small.
  • the pixels of the scene in the background can be removed, and only the pixels of the foreground scene are retained.
  • the processing module 30 is configured to use the resized area as the current focus area.
  • the focus area adjusting device of the embodiment may first obtain the depth information corresponding to the current focus area during the photographing process, and then adjust the size of the focus area according to the obtained depth information, and according to the adjusted focus
  • the area focuses on the photographed object, and the size of the focus area is adjusted by the acquired depth information.
  • the size of the focus area is adjusted accordingly, instead of manually adjusting the size of the focus area to improve the size of the focus area.
  • the second embodiment of the focus area adjustment apparatus of the present application is proposed based on the first embodiment.
  • the focus area adjustment apparatus further includes:
  • a judging module configured to determine a current lighting mode
  • the processing module 30 is further configured to acquire a preset focus area according to the illumination mode, and use the acquired focus area as a current focus area.
  • the illumination mode may optionally include a normal illumination mode and a dim illumination mode.
  • the processing module 30 is further configured to preset the focus area to The default value; when the judging module judges that it is currently in the dim light illumination mode, the processing module 30 is further configured to increase on the basis of the default value of the focus area, so that the focus area becomes larger, thereby making the focus effect more accurate.
  • the embodiment that the processing module 30 is further configured to acquire the in-focus area according to the illumination mode includes: 1) if the current illumination mode of the terminal is the normal illumination mode, the focus area may be preset to 1/4 of the length and width of the picture ( Adjustable); 2) If the current illumination mode of the terminal is dark light illumination mode, the focus area can be increased based on the focus area corresponding to the normal illumination mode, for example, the focus area corresponding to the dark light illumination mode is set to the length of the screen.
  • the width is 1/2 (adjustable), which is equivalent to 1/4 of normal illumination plus 1/4, which is larger than the normal illumination focus area. Understandably, In the dim light mode, the focus area is enlarged, and the amount of light entering the focus area can be increased. At this time, the scene in the dark light illumination mode can be more accurately focused.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the above technical solution realizes that the size of the focus area is adjusted by the obtained depth information, and the size of the focus area is adjusted correspondingly according to the change of the depth information, instead of adjusting the size of the focus area by manual adjustment, thereby improving the focus area adjustment.
  • the accuracy realizes that the size of the focus area is adjusted by the obtained depth information, and the size of the focus area is adjusted correspondingly according to the change of the depth information, instead of adjusting the size of the focus area by manual adjustment, thereby improving the focus area adjustment.
  • the accuracy realizes that the size of the focus area is adjusted by the obtained depth information, and the size of the focus area is adjusted correspondingly according to the change of the depth information, instead of adjusting the size of the focus area by manual adjustment, thereby improving the focus area adjustment.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Studio Devices (AREA)

Abstract

一种对焦区域调整方法和装置,获取当前对焦区域对应的景深信息;根据获取的所述景深信息调整所述对焦区域的尺寸;将调整尺寸后的所述对焦区域作为当前对焦区域。上述技术方案通过获取的景深信息调整对焦区域,实现了通过获取的景深信息调整对焦区域的尺寸,随着景深信息的变化,对焦区域的尺寸也相应进行调整,而不是通过人工调整的方式调整对焦区域的尺寸,提高了对焦区域调整的准确性。

Description

对焦区域调整方法和装置 技术领域
本文涉及但不限于拍照领域,尤其涉及一种对焦区域调整方法和装置。
背景技术
随着科学技术的发展,各种移动设备的功能越来越丰富和智能,生活中人们经常会用各种拍照装置,如手机、相机等进行拍照。目前大部分的拍照设备在进行拍照对焦时,都是通过人工调整对焦参数,从而调整对焦区域的尺寸,而人工调整对焦区域时,容易出现误差,导致对焦区域调整不够准确。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本发明实施例提出一种对焦区域调整方法和装置,旨在解决拍照过程中人工调整对焦区域时,调整不够准确的技术问题。
本发明实施例提供的一种对焦区域调整方法,所述对焦区域调整方法包括以下步骤:
获取当前对焦区域对应的景深信息;
根据获取的所述景深信息调整所述对焦区域的尺寸;
将调整尺寸后的所述对焦区域作为当前对焦区域。
可选地,所述根据获取的所述景深信息调整所述对焦区域的尺寸的步骤包括:
A、根据获取的所述景深信息,计算当前对焦区域中像素点的景深均方差值;
B、比对所述景深均方差值与预设阈值;
C、当所述景深均方差值大于所述阈值时,按预设比例减小所述对焦区域尺寸;
D、获取减小尺寸后的对焦区域的景深信息,并继续执行步骤A和B,直至减小后的对焦区域中像素点的景深均方差小于或等于所述阈值。
可选地,所述方法还包括:所述比对所述景深均方差值与预设阈值的步骤之后,
当所述景深均方差值小于或等于所述阈值时,保持所述对焦区域尺寸不变。
可选地,所述根据获取的所述景深信息调整所述对焦区域的尺寸的步骤包括:
根据获取的所述景深信息,确定所述对焦区域中像素点的景深均值;
基于预设的景深均值与对焦区域尺寸的映射关系,获取确定的景深均值对应的对焦区域尺寸;
根据获取的尺寸对所述对焦区域进行调整。
可选地,所述对焦区域调整方法还包括:所述获取当前对焦区域对应的景深信息的步骤之前,
判断当前所处的光照模式;
根据所述光照模式获取预设的对焦区域,并将获取的所述对焦区域作为当前对焦区域。
此外,本发明实施例还提出一种对焦区域调整装置,所述对焦区域调整装置包括:
获取模块,设置为获取当前对焦区域对应的景深信息;
调整模块,设置为根据获取的所述景深信息调整所述对焦区域的尺寸;
处理模块,设置为将调整尺寸后的所述对焦区域作为当前对焦区域。
可选地,所述调整模块包括:
计算单元,设置为根据获取的所述景深信息,计算当前对焦区域中像素 点的景深均方差值;在所述第一获取单元获取到景深信息后,继续根据获取的所述景深信息,计算减小后的对焦区域中像素点的景深均方差值,所述比对单元继续比对所述景深均方差值与预设阈值,直至减小后的对焦区域中像素点的景深均方差小于或等于所述阈值;
比对单元,设置为比对所述景深均方差值与预设阈值;
减小单元,设置为当所述景深均方差值大于所述阈值时,按预设比例减小所述对焦区域尺寸;
第一获取单元,设置为获取减小尺寸后的对焦区域的景深信息。
可选地,所述调整模块还包括:
保持单元,设置为当所述景深均方差值小于或等于所述阈值时,保持所述对焦区域尺寸不变。
可选地,所述调整模块还包括:
确定单元,设置为根据获取的所述景深信息,确定所述对焦区域中像素点的景深均值;
第二获取单元,设置为基于预设的景深均值与对焦区域尺寸的映射关系,获取确定的景深均值对应的对焦区域尺寸;
调整单元,设置为根据获取的尺寸对所述对焦区域进行调整。
可选地,所述对焦区域调整装置还包括:
判断模块,设置为判断当前所处的光照模式;
所述处理模块,还设置为根据所述光照模式获取预设的对焦区域,并将获取的所述对焦区域作为当前对焦区域。
此外,本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述的方法。
本发明实施例提出的对焦区域调整方法和装置,在拍照过程中,可先获取当前对焦区域对应的景深信息,然后根据获取的所述景深信息调整所述对 焦区域的尺寸,并根据调整后的所述对焦区域对拍照对象进行对焦,实现了通过获取的景深信息调整对焦区域的尺寸,随着景深信息的变化,对焦区域的尺寸也相应进行调整,而不是通过人工调整的方式调整对焦区域的尺寸,提高了对焦区域调整的准确性。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1为本发明第一实施例的对焦区域调整方法流程示意图;
图2为图1中步骤S20的第一实施例细化流程示意图;
图3为图1中步骤S20的第二实施例细化流程示意图;
图4为图1中步骤S20的第三实施例细化流程示意图;
图5为本发明第一实施例的对焦区域调整装置功能模块示意图;
图6为图5中调整模块20的第一实施例细化功能模块示意图;
图7为图5中调整模块20的第二实施例细化功能模块示意图;
图8为图5中调整模块20的第二实施例细化功能模块示意图。
本发明的实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明实施例提供一种对焦区域调整方法。
参照图1,图1为本发明第一实施例的对焦区域调整方法流程示意图。
本实施例提出一种对焦区域调整方法,所述对焦区域调整方法包括:
步骤S10,获取当前对焦区域对应的景深信息;
在本实施例中,所述步骤S10之前,包括获取当前对焦区域的步骤,所述获取当前对焦区域的方式包括:
a、在侦测到对焦指令时,获取预设的对焦区域作为当前对焦区域,如终 端默认将拍照界面的中心位置作为预设的对焦区域,则在拍照对焦时,将拍照界面的中心位置作为当前对焦区域。
b、在拍照过程中,根据用户输入的触摸操作选择对焦区域,即终端显示拍照界面,当用户触摸拍照界面的任一区域时,将用户触摸选择的区域作为当前对焦区域。
c、在拍照过程中,若检测到摄像头与对焦的景物只是发生距离的远近变化,则将前一时刻的对焦区域作为当前的对焦区域。
d、根据当前的光照模式获取当前的对焦区域,此处在下文的实施例中具体详述。
以上所列举出的四种获取当前对焦区域的方式仅仅为示例性的,根据其具体需求所提出的其它各种获取当前对焦区域的方式均在本发明的保护范围内。
在本实施例中,所述获取当前对焦区域对应的景深信息的方式包括:
1)方式一:在拍照过程中,通过终端预设的双目摄像头对所述对焦区域进行对焦,以获取所述对焦区域的景深信息,可以理解的是,所述双目摄像头之间的距离是一定的(如2mm),利用双目摄像头对所述对焦区域进行对焦时,可获取双目摄像头与对焦景物之间角度差,然后通过预设的计算公式如正弦定理即可计算出景深信息。通过双目摄像头对景物进行对焦,计算两个摄像头的景深信息的平均值,使得获取到的景深信息更加精确。同时,双目摄像头中的对应像素点成对出现时,终端分析哪个像素对现场的还原度比较高,选择还原度较高的像素,可以有效抑制了噪点的干扰,使两个小镜头能获得类似一个大镜头的效果,噪点更少、景深信息更加精确。
2)方式二:在对对焦区域对应的景物进行对焦时,先通过终端预设的红外传感器发射红外信号,然后接收前方物体的反射光,并通过预设的计算公式获取景深信息,例如,红外传感器发送红外光线时,遇到物体会放射光线,可通过计算对焦景物反射光线的时间,以及光的传播速度,从而计算出对焦景物的景深信息。
3)方式三:先识别拍照画面中对焦区域对应的景物,然后根据预设的景 物模式对对焦区域对应的景物选择对应的景物模式,确认完毕后,根据预设景物模式映射的景深信息,确定对焦区域对应的景物与摄像头之间的近似距离,然后再通过双目摄像头或者红外传感器获取精确的景深信息。
以上所列举出的三种获取当前对焦区域的景深信息的方式仅仅为示例性的,根据其具体需求所提出的其它各种获取当前对焦区域的景深信息的方式均在本发明的保护范围内。
步骤S20,根据获取的所述景深信息调整所述对焦区域的尺寸;
在本实施例中,所述步骤S20的实施例包括:
1)第一实施例,参照图2,所述步骤S20包括:
步骤S21,根据获取的所述景深信息,计算当前对焦区域中像素点的景深均方差值;
步骤S22,比对所述景深均方差值与预设阈值;
步骤S23,当所述景深均方差值大于所述阈值时,按预设比例减小所述对焦区域尺寸;
步骤S24,获取减小尺寸后的对焦区域的景深信息,并继续执行步骤S21和S22,直至减小后的对焦区域中像素点的景深均方差小于或等于所述阈值。
在本实施例中,所述预设阈值THx可根据正常光照模式和暗光模式两种模式进行设置,例如,当景深距离t为20cm~3m,则预设阈值THx可以为:景深距离t为20cm~30cm时,预设阈值为Th1;当景深距离t为30cm~50cm时,预设阈值为Th2;景深距离t为50cm~1m时,预设阈值为Th3。按照依次类推的方式预设出阈值,要注意的是,Thx设置原则是,摄像头距离越近,即景深距离越小,阈值Thx值越小,且在暗光光照模式下和正常光照模式下分别可调。
在本实施例中,可选方案为,先确定所述对焦区域中的每个像素点景深值,然后根据每个像素点计算出平均值,最后计算出所述对焦区域中像素点的景深均方差值Ms(mean square),将所述景深均方差值与预设阈值进行比对,当所述景深均方差值Ms大于所述预设阈值Thx时,此时是存在不同焦平面的物体在对焦区域中,导致对焦效果不明显,为减少对焦的误差,可选 方案为:终端以对焦区域中的焦点为中心,按照预设的方式减小所述对焦区域尺寸,如按照预设比例(10%)减小所述对焦区域尺寸,并将减小后对焦区域中像素点的景深均方差值与预设阈值进行比对,若所述景深均方差值仍然大于所述预设阈值时,则继续按照预设的方式减小所述对焦区域尺寸,直至所述减小后的对焦区域中像素点的景深均方差小于或等于所述预设阈值,可以理解的是,当所述对焦区域中像素点的景深均方差小于或等于所述预设阈值时,此时对焦区域中的景物是处于同一焦平面的景物,使得对焦更加准确。
在本实施例中,在拍照过程中,先通过双目摄像头或者红外传感器等获取景深信息,然后根据景深信息计算对焦区域中像素点的景深均方差,将所述景深均方差与预设阈值进行比对,根据比对结果动态调整对焦区域尺寸,实现在拍摄微距物体时,能更准确的获取对焦区域的大小,以防止不同焦平面的物体进入对焦区域,并根据调整后的所述对焦区域对拍照对象进行对焦,在调整后,不会因为对焦区域过大时不同景深信息的景物都进入对焦区域而导致对焦错误,而是通过景深信息调整所述对焦区域的尺寸,使得对焦区域中的景物是在一个焦平面上的景物,提高了拍照过程中对焦的准确性。
2)第二实施例,参照图3,所述步骤S22之后,所述步骤S20还包括:
步骤S25,当所述景深均方差值小于或等于所述阈值时,保持所述对焦区域尺寸不变。
在本实施例中,当所述景深均方差值小于或等于所述预设阈值时,说明此时对焦区域的对焦范围不会大于对焦景物的预设范围,不会造成对焦模糊,而导致对对焦不清楚;同时对焦范围也不会小于对焦景物的预设范围,减少了噪声的干扰,则保持所述对焦区域尺寸不变。
3)第三实施例,参照图4,所述步骤S30包括:
步骤S26,根据获取的所述景深信息,确定所述对焦区域中像素点的景深均值;
步骤S27,基于预设的景深均值与对焦区域尺寸的映射关系,获取确定的景深均值对应的对焦区域尺寸;
步骤S28,根据获取的尺寸对所述对焦区域进行调整。
在本实施例中,根据多次实现测试试验以及分析结果,总结出景深均值与对焦区域的对应关系。可选方案为,先计算出对焦区域中像素点的景深均值,也就是计算对焦区域中每个像素点的景深距离值,再对每个像素点求平均值,并根据所述景深均值确定出对应的对焦区域值,并将画面的对焦区域调整为预设景深均值对应的对焦区域值,例如:当景深信息为20~30cm时,将对焦区域调整为拍照画面长宽的1/8;当景深信息为30~50cm时,将对焦区域值调整为画面长宽的1/7,即根据景深信息实时调整对焦区域尺寸。可以理解的是,所述景深均值与对焦区域的映射关系根据多次测验结果分析出来的,也可根据具体需要设置为其它的值。可以理解的是,当获取的所述尺寸与所述对焦区域合适,无需调整时,此时对焦区域可以不响应所述调整指令,或者,调整尺寸后,保持对焦区域尺寸不变。
可选地,在检测到对焦区域中存在不同焦平面的景物时,可识别出不同焦平面的景物的景深距离,例如,前景中的景物占据对焦区域的面积较大时,背景中景物占据对焦区域的面积较小,此时,可将背景中的景物的像素点去除,只保留前景景物的像素点。
步骤S30,将调整尺寸后的所述对焦区域作为当前对焦区域。
本实施例提出的对焦区域调整方法,在拍照过程中,可先获取当前对焦区域对应的景深信息,然后根据获取的所述景深信息调整所述对焦区域的尺寸,并根据调整后的所述对焦区域对拍照对象进行对焦,实现了通过获取的景深信息调整对焦区域的尺寸,随着景深信息的变化,对焦区域的尺寸也相应进行调整,而不是通过人工调整的方式调整对焦区域的尺寸,提高了对焦区域调整的灵活性。
可选地,为了增加终端拍照过程中对焦的准确性,基于第一实施例提出本申请对焦区域调整方法的第二实施例,在本实施例,所述步骤S10之前,所述对焦区域调整方法还包括步骤:
判断当前所处的光照模式;
根据所述光照模式获取预设的对焦区域,并将获取的所述对焦区域作为当前对焦区域。
在本实施例中,所述光照模式可选包括正常光照模式和暗光光照模式,当终端当前处于正常光照模式时,可将对焦区域预设为默认值;当终端处于暗光光照模式时,可在对焦区域默认值的基础上进行增加,使得对焦区域变大,从而使得对焦效果更加准确。即所述根据所述光照模式获取对焦区域的实施例包括:1)若终端当前的光照模式为正常光照模式,可将对焦区域预设为画面长宽的1/4(可调);2)若终端当前的光照模式为暗光光照模式,则可在正常光照模式对应的对焦区域基础上加大对焦区域,如将暗光光照模式对应的对焦区域设置为为画面长宽的1/2(可调),相当于正常光照的1/4再加上1/4,大于正常光照对焦区域。可以理解的是,暗光光照模式下,对焦区域加大,可以加大对焦区域的进光量,此时,可更准确对暗光光照模式下的景物进行对焦。
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述的方法。
本发明实施例进一步提供一种对焦区域调整装置。
参照图5,图5为本发明第一实施例的对焦区域调整装置功能模块示意图。
需要强调的是,对本领域的技术人员来说,图5所示功能模块图仅仅是一个示例图,本领域的技术人员围绕图5所示的对焦区域调整装置的功能模块,可轻易进行新的功能模块的补充;每个功能模块的名称是自定义名称,仅用于辅助理解该对焦区域调整装置的每个程序功能块,不用于限定本申请的技术方案。
本实施例提出一种对焦区域调整装置,所述对焦区域调整装置包括:
获取模块10,设置为获取当前对焦区域对应的景深信息;
在本实施例中,所述获取模块10还设置为获取当前对焦区域,所述获取 模块10获取当前对焦区域的方式包括:
a、在侦测到对焦指令时,所述获取模块10设置为获取预设的对焦区域作为当前对焦区域,如默认将拍照界面的中心位置作为预设的对焦区域,则在拍照对焦时,将拍照界面的中心位置作为当前对焦区域。
b、在拍照过程中,根据用户输入的触摸操作选择对焦区域,即先显示拍照界面,当用户触摸拍照界面的任一区域时,所述获取模块10设置为将用户触摸选择的区域作为当前对焦区域。
c、在拍照过程中,若检测到摄像头与对焦的景物只是发生距离的远近变化,则所述获取模块10设置为将前一时刻的对焦区域作为当前的对焦区域。
d、根据当前的光照模式获取当前的对焦区域,此处在下文的实施例中具体详述。
以上所列举出的四种获取当前对焦区域的方式仅仅为示例性的,根据其具体需求所提出的其它各种获取当前对焦区域的方式均在本发明的保护范围内。
在本实施例中,所述获取模块10获取当前对焦区域对应的景深信息的方式包括:
1)方式一:在拍照过程中,所述获取模块10设置为通过预设的双目摄像头对所述对焦区域进行对焦,以获取所述对焦区域的景深信息,可以理解的是,所述双目摄像头之间的距离是一定的,利用双目摄像头对所述对焦区域进行对焦时,所述获取模块10设置为可获取双目摄像头与对焦景物之间角度差,然后通过预设的计算公式如正弦定理即可计算出景深信息。通过双目摄像头对景物进行对焦,计算两个摄像头的景深信息的平均值,使得获取到的景深信息更加精确。同时,双目摄像头中的对应像素点成对出现时,可先分析哪个像素对现场的还原度比较高,选择还原度较高的像素,可以有效抑制了噪点的干扰,使两个小镜头能获得类似一个大镜头的效果,噪点更少、景深信息更加精确。
2)方式二:在对对焦区域对应的景物进行对焦时,所述获取模块10设置为先通过终端预设的红外传感器发射红外信号,然后接收前方物体的反射 光,并通过预设的计算公式获取景深信息,例如,红外传感器发送红外光线时,遇到物体会放射光线,可通过计算对焦景物反射光线的时间,以及光的传播速度,从而计算出对焦景物的景深信息。
3)方式三:先识别拍照画面中对焦区域对应的景物,然后根据预设的景物模式对对焦区域对应的景物选择对应的景物模式,确认完毕后,根据预设景物模式映射的景深信息,确定对焦区域对应的景物与摄像头之间的近似距离,然后所述获取模块10设置为再通过双目摄像头或者红外传感器获取精确的景深信息。
以上所列举出的三种获取当前对焦区域的景深信息的方式仅仅为示例性的,根据其具体需求所提出的其它各种获取当前对焦区域的景深信息的方式均在本发明的保护范围内。
调整模块20,设置为根据获取的所述景深信息调整所述对焦区域的尺寸;
在本实施例中,所述调整模块20设置为根据获取的所述景深信息调整所述对焦区域的实施例包括:
1)第一实施例,参照图6,所述调整模块20包括:
计算单元21,设置为根据获取的所述景深信息,计算当前对焦区域中像素点的景深均方差值;
比对单元22,设置为比对所述景深均方差值与预设阈值;
减小单元23,设置为当所述景深均方差值大于所述阈值时,按预设比例减小所述对焦区域尺寸;
第一获取单元24,设置为在获取减小尺寸后的对焦区域的景深信息;
所述计算单元21还设置为继续根据获取的所述景深信息,计算减小后的对焦区域中像素点的景深均方差值,所述比对单元22还设置为继续比对所述景深均方差值与预设阈值,直至减小后的对焦区域中像素点的景深均方差小于或等于所述阈值。
在本实施例中,所述预设阈值THx可根据正常光照模式和暗光模式两种模式进行设置,例如,当景深距离t为20cm~3m,则预设阈值THx可以为:景深距离t为20cm~30cm时,预设阈值为Th1;当景深距离t为30cm~50cm 时,预设阈值为Th2;景深距离t为50cm~1m时,预设阈值为Th3。按照依次类推的方式预设出阈值,要注意的是,Thx设置原则是,摄像头距离越近,即景深距离越小,阈值Thx值越小,且在暗光光照模式下和正常光照模式下分别可调。
在本实施例中,可选方案为,先确定所述对焦区域中的每个像素点景深值,然后所述计算单元21设置为根据每个像素点计算出平均值,最后计算出所述对焦区域中像素点的景深均方差值Ms(mean square),所述比对单元22设置为将所述景深均方差值与预设阈值进行比对,当所述景深均方差值Ms大于所述预设阈值Thx时,此时是存在不同焦平面的物体在对焦区域中,导致对焦效果不明显,为减少对焦的误差,可选方案为:以对焦区域中的焦点为中心,所述减小单元23设置为按照预设的方式减小所述对焦区域尺寸,如按照预设比例(10%)减小所述对焦区域尺寸,然后所述比对单元22设置为将减小后对焦区域中像素点的景深均方差值与预设阈值进行比对,若所述景深均方差值仍然大于所述预设阈值时,则所述比对单元22设置为继续按照预设的方式减小所述对焦区域尺寸,直至所述减小后的对焦区域中像素点的景深均方差小于或等于所述预设阈值,可以理解的是,当所述对焦区域中像素点的景深均方差小于或等于所述预设阈值时,此时对焦区域中的景物是处于同一焦平面的景物,使得对焦更加准确。
在本实施例中,在拍照过程中,所述获取模块10设置为先通过双目摄像头或者红外传感器等获取景深信息,然后所述计算单元21设置为根据景深信息计算对焦区域中像素点的景深均方差,所述比对单元22设置为将所述景深均方差与预设阈值进行比对,根据比对结果动态调整对焦区域尺寸,实现在拍摄微距物体时,能更准确的获取对焦区域的大小,以防止不同焦平面的物体进入对焦区域,并根据调整后的所述对焦区域对拍照对象进行对焦,在调整后,不会因为对焦区域过大时不同景深信息的景物都进入对焦区域而导致对焦错误,而是通过景深信息调整所述对焦区域的尺寸,使得对焦区域中的景物是在一个焦平面上的景物,提高了拍照过程中对焦的准确性。
所述获取模块10设置为先通过双目摄像头或者红外传感器等获取景深信息,然后调整模块20中的计算单元21设置为根据景深信息计算对焦区域 中像素点的景深均方差,将所述景深均方差与预设阈值进行比对,并比对结果动态调整对焦区域尺寸,实现在拍摄微距物体时,能更准确的获取对焦区域的大小,从而使得对焦更准确。
2)第二实施例,参照图7,所述调整模块20还包括:
保持单元25,设置为当所述景深均方差值小于或等于所述阈值时,保持所述对焦区域尺寸不变。
在本实施例中,当所述景深均方差值小于或等于所述预设阈值时,说明此时对焦区域的对焦范围不会大于对焦景物的预设范围,不会造成对焦模糊,而导致对对焦不清楚;同时对焦范围也不会小于对焦景物的预设范围,减少了噪声的干扰,此时,所述保持单元25保持所述对焦区域尺寸不变。
3)第三实施例,参照图8,所述调整模块20还包括:
确定单元26,设置为根据获取的所述景深信息,确定所述对焦区域中像素点的景深均值;
第二获取单元27,设置为基于预设的景深均值与对焦区域尺寸的映射关系,获取确定的景深均值对应的对焦区域尺寸;
调整单元28,设置为根据获取的尺寸对所述对焦区域进行调整。
在本实施例中,根据多次实现测试试验以及分析结果,总结出景深均值与对焦区域的对应关系。可选方案为,所述确定单元26设置为先计算出对焦区域中像素点的景深均值,也就是计算对焦区域中每个像素点的景深距离值,再对每个像素点求平均值,并且所述第二获取单元27设置为根据所述景深均值确定出对应的对焦区域值,并且所述调整单元28设置为将画面的对焦区域调整为预设景深均值对应的对焦区域值,例如:当景深信息为20~30cm时,将对焦区域调整为拍照画面长宽的1/8;当景深信息为30~50cm时,将对焦区域值调整为画面长宽的1/7,即根据景深信息实时调整对焦区域尺寸。可以理解的是,所述景深均值与对焦区域的映射关系根据多次测验结果分析出来的,也可根据具体需要设置为其它的值。可以理解的是,当获取的所述尺寸与所述对焦区域合适,无需调整时,此时对焦区域可以不响应所述调整指令,或者,调整尺寸后,保持对焦区域尺寸不变。
可选地,在检测到对焦区域中存在不同焦平面的景物时,可识别出不同焦平面的景物的景深距离,例如,前景中的景物占据对焦区域的面积较大时,背景中景物占据对焦区域的面积较小,此时,可将背景中的景物的像素点去除,只保留前景景物的像素点。
处理模块30,设置为将调整尺寸后的所述对焦区域作为当前对焦区域。
本实施例提出的对焦区域调整装置,在拍照过程中,可先获取当前对焦区域对应的景深信息,然后根据获取的所述景深信息调整所述对焦区域的尺寸,并根据调整后的所述对焦区域对拍照对象进行对焦,实现了通过获取的景深信息调整对焦区域的尺寸,随着景深信息的变化,对焦区域的尺寸也相应进行调整,而不是通过人工调整的方式调整对焦区域的尺寸,提高了对焦区域调整的灵活性。
可选地,为了增加终端拍照过程中对焦的准确性,基于第一实施例提出本申请对焦区域调整装置的第二实施例,在本实施例,所述对焦区域调整装置还包括:
判断模块,设置为判断当前所处的光照模式;
所述处理模块30,还设置为根据所述光照模式获取预设的对焦区域,并将获取的所述对焦区域作为当前对焦区域。
在本实施例中,所述光照模式可选包括正常光照模式和暗光光照模式,当所述判断模块判断当前处于正常光照模式时,所述处理模块30还设置为可将对焦区域预设为默认值;当所述判断模块判断当前处于暗光光照模式时,所述处理模块30还设置为可在对焦区域默认值的基础上进行增加,使得对焦区域变大,从而使得对焦效果更加准确。即所述处理模块30还设置为根据所述光照模式获取对焦区域的实施例包括:1)若终端当前的光照模式为正常光照模式,可将对焦区域预设为画面长宽的1/4(可调);2)若终端当前的光照模式为暗光光照模式,则可在正常光照模式对应的对焦区域基础上加大对焦区域,如将暗光光照模式对应的对焦区域设置为为画面长宽的1/2(可调),相当于正常光照的1/4再加上1/4,大于正常光照对焦区域。可以理解的是, 暗光光照模式下,对焦区域加大,可以加大对焦区域的进光量,此时,可更准确对暗光光照模式下的景物进行对焦。
以上内容是结合具体的实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
工业实用性
上述技术方案实现了通过获取的景深信息调整对焦区域的尺寸,随着景深信息的变化,对焦区域的尺寸也相应进行调整,而不是通过人工调整的方式调整对焦区域的尺寸,提高了对焦区域调整的准确性。

Claims (11)

  1. 一种对焦区域调整方法,所述对焦区域调整方法包括以下步骤:
    获取当前对焦区域对应的景深信息;
    根据获取的所述景深信息调整所述对焦区域的尺寸;
    将调整尺寸后的所述对焦区域作为当前对焦区域。
  2. 如权利要求1所述的对焦区域调整方法,其中,所述根据获取的所述景深信息调整所述对焦区域的尺寸的步骤包括:
    A、根据获取的所述景深信息,计算当前对焦区域中像素点的景深均方差值;
    B、比对所述景深均方差值与预设阈值;
    C、当所述景深均方差值大于所述阈值时,按预设比例减小所述对焦区域尺寸;
    D、获取减小尺寸后的对焦区域的景深信息,并继续执行步骤A和B,直至减小后的对焦区域中像素点的景深均方差小于或等于所述阈值。
  3. 如权利要求2所述的对焦区域调整方法,所述方法还包括:
    所述比对所述景深均方差值与预设阈值的步骤之后,当所述景深均方差值小于或等于所述阈值时,保持所述对焦区域尺寸不变。
  4. 如权利要求1所述的对焦区域调整方法,其中,所述根据获取的所述景深信息调整所述对焦区域的尺寸的步骤包括:
    根据获取的所述景深信息,确定所述对焦区域中像素点的景深均值;
    基于预设的景深均值与对焦区域尺寸的映射关系,获取确定的景深均值对应的对焦区域尺寸;
    根据获取的尺寸对所述对焦区域进行调整。
  5. 如权利要求1-4任一项所述的对焦区域调整方法,所述方法还包括:
    所述获取当前对焦区域对应的景深信息的步骤之前,判断当前所处的光照模式;
    根据所述光照模式获取预设的对焦区域,并将获取的所述对焦区域作为当前对焦区域。
  6. 一种对焦区域调整装置,所述对焦区域调整装置包括:
    获取模块,设置为获取当前对焦区域对应的景深信息;
    调整模块,设置为根据获取的所述景深信息调整所述对焦区域的尺寸;
    处理模块,设置为将调整尺寸后的所述对焦区域作为当前对焦区域。
  7. 如权利要求6所述的对焦区域调整装置,其中,所述调整模块包括:
    计算单元,设置为根据获取的所述景深信息,计算当前对焦区域中像素点的景深均方差值;在所述第一获取单元获取到景深信息后,继续根据获取的所述景深信息,计算减小后的对焦区域中像素点的景深均方差值,所述比对单元继续比对所述景深均方差值与预设阈值,直至减小后的对焦区域中像素点的景深均方差小于或等于所述阈值;
    比对单元,设置为比对所述景深均方差值与预设阈值;
    减小单元,设置为当所述景深均方差值大于所述阈值时,按预设比例减小所述对焦区域尺寸;
    第一获取单元,设置为获取减小尺寸后的对焦区域的景深信息。
  8. 如权利要求7所述的对焦区域调整装置,所述调整模块还包括:
    保持单元,设置为当所述景深均方差值小于或等于所述阈值时,保持所述对焦区域尺寸不变。
  9. 如权利要求6所述的对焦区域调整装置,所述调整模块还包括:
    确定单元,设置为根据获取的所述景深信息,确定所述对焦区域中像素点的景深均值;
    第二获取单元,设置为基于预设的景深均值与对焦区域尺寸的映射关系,获取确定的景深均值对应的对焦区域尺寸;
    调整单元,设置为根据获取的尺寸对所述对焦区域进行调整。
  10. 如权利要求6-9任一项所述的对焦区域调整装置,所述对焦区域调整装置还包括:
    判断模块,设置为判断当前所处的光照模式;
    所述处理模块,还设置为根据所述光照模式获取预设的对焦区域,并将获取的所述对焦区域作为当前对焦区域。
  11. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1~5中任一项所述的方法。
PCT/CN2015/091763 2015-06-12 2015-10-12 对焦区域调整方法和装置 WO2016197494A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510324001.6A CN106303205A (zh) 2015-06-12 2015-06-12 对焦区域调整方法和装置
CN201510324001.6 2015-06-12

Publications (1)

Publication Number Publication Date
WO2016197494A1 true WO2016197494A1 (zh) 2016-12-15

Family

ID=57502945

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/091763 WO2016197494A1 (zh) 2015-06-12 2015-10-12 对焦区域调整方法和装置

Country Status (2)

Country Link
CN (1) CN106303205A (zh)
WO (1) WO2016197494A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971812B (zh) * 2018-09-30 2022-03-04 北京微播视界科技有限公司 一种拍摄方法、装置、电子设备及存储介质
CN110971814B (zh) * 2018-09-30 2022-03-04 北京微播视界科技有限公司 一种拍摄调整方法、装置、电子设备及存储介质
CN112235563B (zh) * 2019-07-15 2023-06-30 北京字节跳动网络技术有限公司 一种对焦测试方法、装置、计算机设备及存储介质
WO2021102961A1 (zh) * 2019-11-29 2021-06-03 深圳市大疆创新科技有限公司 拍摄装置的对焦方法、图像处理设备及存储介质
CN112653835B (zh) * 2020-12-14 2022-02-08 浙江大华技术股份有限公司 聚焦状态的判断方法、装置及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070285557A1 (en) * 2006-05-11 2007-12-13 Asia Optical Co., Inc. Method of auto focus
US20080055460A1 (en) * 2006-09-01 2008-03-06 Primax Electronics Ltd. Auto focus method for obtaining image having two subjects
CN101304487A (zh) * 2007-05-10 2008-11-12 富士胶片株式会社 调焦设备、方法和程序
US20090256951A1 (en) * 2008-04-11 2009-10-15 Panasonic Corporation Imaging Device
EP2667231A1 (en) * 2011-01-18 2013-11-27 FUJIFILM Corporation Auto focus system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070285557A1 (en) * 2006-05-11 2007-12-13 Asia Optical Co., Inc. Method of auto focus
US20080055460A1 (en) * 2006-09-01 2008-03-06 Primax Electronics Ltd. Auto focus method for obtaining image having two subjects
CN101304487A (zh) * 2007-05-10 2008-11-12 富士胶片株式会社 调焦设备、方法和程序
US20090256951A1 (en) * 2008-04-11 2009-10-15 Panasonic Corporation Imaging Device
EP2667231A1 (en) * 2011-01-18 2013-11-27 FUJIFILM Corporation Auto focus system

Also Published As

Publication number Publication date
CN106303205A (zh) 2017-01-04

Similar Documents

Publication Publication Date Title
JP6946188B2 (ja) 複数技術奥行きマップ取得および融合のための方法および装置
CN109451244B (zh) 一种基于液体镜头的自动调焦方法及系统
US9998650B2 (en) Image processing apparatus and image pickup apparatus for adding blur in an image according to depth map
CN109521547B (zh) 一种变步长的自动调焦方法及系统
KR102143456B1 (ko) 심도 정보 취득 방법 및 장치, 그리고 이미지 수집 디바이스
KR101345093B1 (ko) 자동 초점 제어 장치, 이미지 캡처 장치 및 초점 자동 조절 방법
EP2615484B1 (en) Automatic focusing apparatus and method with calibration and slope correction
WO2016197494A1 (zh) 对焦区域调整方法和装置
WO2016000330A1 (zh) 一种焦距调节方法、装置和终端、计算机存储介质
WO2015184978A1 (zh) 摄像机控制方法、装置及摄像机
WO2019105261A1 (zh) 背景虚化处理方法、装置及设备
US9160931B2 (en) Modifying captured image based on user viewpoint
WO2019105254A1 (zh) 背景虚化处理方法、装置及设备
US10212331B2 (en) Imaging device and method for automatic focus in an imaging device as well as a corresponding computer program
KR20150085710A (ko) 디스플레이 장치 및 그 제어 방법
WO2020042581A1 (zh) 一种图像获取设备的对焦方法及装置
US20150304625A1 (en) Image processing device, method, and recording medium
JP2018528631A (ja) ステレオオートフォーカス
TWI393981B (zh) Use the flash to assist in detecting focal lengths
WO2023072030A1 (zh) 镜头自动对焦方法及装置、电子设备和计算机可读存储介质
US9843715B2 (en) Photographic apparatus, stroboscopic image prediction method, and a non-transitory computer readable storage medium storing stroboscopic image prediction program
WO2018161322A1 (zh) 基于深度的图像处理方法、处理装置和电子装置
TW201642008A (zh) 影像擷取裝置及其動態對焦方法
KR20190074585A (ko) 비디오 프로젝터용 포커싱방법, 장치 및 저장매체에 저장된 프로그램
TWI578783B (zh) 控制對焦與自動曝光的方法與系統

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15894758

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15894758

Country of ref document: EP

Kind code of ref document: A1