WO2023185683A1 - 微距拍摄方法、电子设备和计算机可读存储介质 - Google Patents
微距拍摄方法、电子设备和计算机可读存储介质 Download PDFInfo
- Publication number
- WO2023185683A1 WO2023185683A1 PCT/CN2023/083740 CN2023083740W WO2023185683A1 WO 2023185683 A1 WO2023185683 A1 WO 2023185683A1 CN 2023083740 W CN2023083740 W CN 2023083740W WO 2023185683 A1 WO2023185683 A1 WO 2023185683A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- macro
- camera
- macro camera
- picture
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 147
- 230000008569 process Effects 0.000 claims abstract description 62
- 230000004044 response Effects 0.000 claims description 42
- 238000004590 computer program Methods 0.000 claims description 18
- 238000010586 diagram Methods 0.000 description 42
- 230000006870 function Effects 0.000 description 16
- 230000003287 optical effect Effects 0.000 description 16
- 238000012545 processing Methods 0.000 description 14
- 230000007704 transition Effects 0.000 description 13
- 230000000694 effects Effects 0.000 description 11
- 230000008859 change Effects 0.000 description 5
- 230000004927 fusion Effects 0.000 description 5
- 230000003993 interaction Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000007500 overflow downdraw method Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/45—Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from two or more image sensors being of different type or operating in different modes, e.g. with a CMOS sensor for moving images in combination with a charge-coupled device [CCD] for still images
Definitions
- the present application relates to the field of imaging technology, and in particular, to a macro photography method, electronic equipment and computer-readable storage media.
- Macro shooting can capture tiny objects at ultra-close range, giving users a different photography experience.
- miniaturization technology of macro camera modules it has become possible to achieve macro photography on miniaturized and portable electronic devices.
- a single fixed-focus macro camera is usually used to achieve the macro shooting function.
- mobile phones use the ultra-wide-angle macro camera's ultra-close focusing capabilities and digital zoom to achieve ultra-wide-angle macro shooting functions.
- a single fixed-focus macro camera has a single focal length, can cover less focal lengths, and has poor macro shooting effects.
- Embodiments of the present application provide a macro photography method, electronic equipment, and a computer-readable storage medium, which can solve the problem of a single focal length covered by existing macro photography and poor macro photography effects.
- embodiments of the present application provide a macro shooting method, which is applied to an electronic device.
- the electronic device includes at least two macro cameras.
- the method includes:
- the zoom magnification is the camera switching magnification
- the picture displayed in the viewfinder is switched from the picture captured by the first macro camera to the picture captured by the second macro camera;
- the zoom magnification is greater than the camera switching magnification and is in the second magnification range
- the image captured by the second macro camera is displayed in the viewfinder, and the second magnification range includes the camera switching magnification
- the focal length of the first macro camera and the focal length of the second macro camera are different; the at least two macro cameras include a first macro camera and a second macro camera.
- the embodiment of the present application performs switching relay based on macro cameras with different focal lengths to achieve macro shooting with a wider focal length, and the macro shooting effect is better.
- the first macro camera is an ultra-wide-angle macro camera
- the second macro camera is a telephoto macro camera
- the first magnification range is 0.5x ⁇ 3.5x
- the second magnification range is 3.5x ⁇ 15x.
- the camera The switching magnification is 3.5x.
- the zoom magnification is in the first magnification range, that is, the ultra-wide-angle focal length
- the ultra-wide-angle macro camera is used for macro shooting
- the zoom magnification reaches the camera switching magnification the ultra-wide-angle macro camera is switched to the telephoto macro camera
- the zoom magnification is in the second magnification range, that is, the telephoto focal length
- the telephoto macro camera is used for macro photography.
- the picture displayed in the viewfinder can be macro photography The full FOV picture or partial FOV picture captured by the head.
- the method also includes:
- a navigation window is superimposed on the preview screen displayed in the viewfinder, and the navigation window is used to display the navigation screen; the field of view angle of the navigation screen is greater than the field of view angle of the preview screen.
- a navigation screen with a larger Field of View is superimposed on the preview screen, which facilitates users to find the subject and composition during macro shooting, and improves the user's macro shooting experience.
- the navigation screen and preview screen can be the full FOV screen or part of the FOV screen captured by the macro camera.
- the navigation picture is the picture captured by the first macro camera
- the preview picture is the picture captured by the second macro camera.
- the image captured by the telephoto macro camera is used as the preview image
- the image captured by the ultra-wide-angle macro camera is used as the navigation image.
- the navigation picture and the preview picture are both pictures captured by the first macro camera; and/or, when the zoom magnification is in the second magnification range, The navigation screen and preview screen are both captured by the second macro camera.
- the navigation picture and the preview picture are both pictures captured by the first macro camera; when the zoom magnification is in the second magnification range, the navigation picture is the picture captured by the first macro camera. The picture captured by one macro camera, and the preview picture is the picture captured by the second macro camera.
- the zoom magnification when the zoom magnification is in the first magnification range, the navigation picture and the preview picture are both pictures captured by the first macro camera; when the zoom magnification is in the third magnification range, the navigation picture is the third magnification range.
- the picture captured by one macro camera, the preview picture is the picture captured by the second macro camera; when the zoom magnification is in the fourth magnification range, the navigation picture and the preview picture are the pictures captured by the second macro camera; among them, the second magnification
- the range includes a third magnification range and a fourth magnification range, and the third magnification range includes a camera switching magnification.
- the first magnification range is 0.5x ⁇ 3.5x, which is ultra-wide-angle preview and ultra-wide-angle navigation; the second magnification range is 3.5x ⁇ 15x, and the third magnification range is 3.5x ⁇ 10x, which is long-distance navigation. Focus preview and ultra-wide-angle navigation; the second magnification range is greater than 10x, at this time it is telephoto preview and telephoto navigation.
- the zoom magnification is in the first magnification range
- the picture captured by the first macro camera is displayed in the viewfinder, and the navigation window is superimposed on the preview picture displayed in the viewfinder, including:
- the zoom process in the first magnification range perform image offset cropping on the image collected by the first macro camera according to the initially calibrated image offset value or the last updated image offset value to obtain the first cropped image;
- the image offset value the position of the first cropped image in the image collected by the first macro camera is identified by the logo pattern, and the first logo image is obtained;
- the first cropped image is displayed in the viewfinder frame, and in the navigation window of the viewfinder frame
- the first identification image is displayed in the display; wherein, the identification pattern is used to identify the relative positional relationship between the preview screen and the navigation screen.
- the relative positional relationship between the preview screen and the navigation screen is obtained through image matching, and is marked in the navigation window through a logo pattern.
- the user can know the position of the preview screen FOV in the navigation screen FOV based on the logo pattern.
- the identification pattern is a rectangular frame.
- the image collected by the first macro camera is also subject to image offset cropping according to the image offset value, so that The picture transition during zooming is smoother and more natural, improving the user's macro shooting experience.
- the first magnification range is 0.5x ⁇ 3.5x.
- the image offset value between the center of the telephoto frame and the center of the ultra-wide-angle frame is determined through image matching. And perform image offset cropping on the ultra-wide-angle picture according to the image offset value, and use the cropped image as the sending image, and mark the position of the preview screen FOV in the navigation screen FOV according to the image offset value, and obtain the super wide-angle frame including the rectangular frame.
- the wide-angle image i.e., the first logo image
- the ultra-wide-angle image can be reduced first, and then the position of the preview screen can be marked in the reduced image according to the offset value to obtain a navigation screen including the mark, and then the navigation screen including the mark can be displayed at the corresponding position of the viewfinder.
- the navigation window is smaller than the viewfinder frame, that is, the viewfinder frame includes the navigation window.
- the method also includes:
- the image offset value of the image collected by the macro camera, and the offset value is updated according to the image offset value of the image collected by the first macro camera.
- determining the image offset value of the image collected by the first macro camera according to the first image feature matching result and the zoom magnification of the image collected by the first macro camera includes:
- offset represents the offset value from the center of the field of view of the first macro camera to the center of the field of view of the second macro camera, which is a pre-calibrated offset value , or image feature matching result
- offset pre represents the image offset value of the previous frame image
- offset cur represents the image offset value of the current frame image
- zoom pre represents the zoom magnification of the previous frame image
- zoom cur represents the current frame image
- zoom magnification represents the zoom magnification at the end of the image shift, which is less than or equal to the camera switching magnification
- zoom start represents the zoom magnification at the beginning of the image shift, which is greater than or equal to the minimum zoom magnification of the first macro camera.
- the zoom magnification is in the second magnification range or the third magnification range; the image captured by the second macro camera is displayed in the viewfinder, and the navigation window is superimposed on the preview image displayed in the viewfinder.
- the image collected by the second macro camera is digitally zoomed and cropped to obtain a second cropped image; according to the initially calibrated image offset value or the last updated image offset Shift the value, identify the position of the second cropped image in the target image through the logo pattern, and obtain the second logo image; display the second cropped image in the viewfinder, and display the second logo image in the navigation window of the viewfinder; wherein,
- the target image is a third cropped image obtained by performing image offset cropping on the image collected by the first macro camera according to the initially calibrated image offset value or the updated image offset value; or, the full cropped image collected by the first macro camera.
- the navigation screen is superimposed on the preview screen to facilitate the user to compose macro shots and find the subject.
- the telephoto image captured by the telephoto macro camera is used as the preview image
- the image captured by the ultra-wide-angle macro camera is used as the navigation image.
- the second identification image may be a telephoto cropped image including a rectangular frame;
- the position of the preview FOV can be marked in the image cropped from the ultra-wide-angle image according to the offset value to obtain the marked image, and then a reduced image of the marked image can be obtained to obtain the navigation screen.
- the method further includes: performing image feature matching based on the second cropped image and the target image to obtain a second image feature matching result; and zooming based on the second image feature matching result and the target image. Magnification, determine the image offset value of the target image, and update the offset value according to the image offset value of the target image.
- the zoom magnification is in the fourth magnification range; the image captured by the second macro camera is displayed in the viewfinder, and the navigation window is superimposed on the preview image displayed in the viewfinder, including: The image collected by the second macro camera is digitally zoomed and cropped to obtain a fourth cropped image; the position of the fourth cropped image in the image collected by the second macro camera is identified by a logo pattern to obtain a third logo image; the fourth cropped image is It is displayed in the viewfinder frame, and the third logo image is displayed in the navigation window of the viewfinder frame.
- the navigation screen is superimposed on the preview screen to facilitate the user to compose macro shots and find the subject.
- the full FOV picture of the telephoto macro camera is used as the navigation picture, and part of the FOV picture is used as the preview picture.
- the method also includes: if the zoom magnification is in the fifth magnification range and a photographing operation is detected, outputting the image collected by the first macro camera in response to the photographing operation; if the zoom magnification In the sixth magnification range, when a photographing operation is detected, in response to the photographing operation, the image collected by the first macro camera and the image collected by the second macro camera are image fused to obtain a fused image, and the fused image is output; if zooming The magnification is in the second magnification range, and when the photographing operation is detected, the image collected by the second macro camera is output in response to the photographing operation; wherein the first magnification range includes the fifth magnification range and the sixth magnification range.
- the first magnification range is 0.5x ⁇ 3.5x
- the fifth magnification range is 0.5x ⁇ 2x
- an ultra-wide-angle macro camera is used to take pictures and the picture is taken
- the sixth magnification range is 2x ⁇ 3.5x, this When 3.5x is greater than or equal to 3.5x, use the telephoto macro camera to take pictures and produce pictures.
- the quality of photographing is improved through image fusion, further improving the user's macro shooting experience.
- the fused image includes a target area and a non-target area, and the image quality of the target area is higher than that of the non-target area; the target area is the difference between the image collected by the first macro camera and the second macro area.
- the target area is an area corresponding to the FOV of the telephoto image in the ultra-wide-angle image. At this time, the ultra-wide-angle picture with a larger FOV covers the telephoto FOV picture.
- the method further includes: detecting the first shooting distance of the image collected by the target camera; if the first shooting distance of the N consecutive frames of images is less than the first threshold, switching from the target camera to the default macro camera, and display the image captured by the default macro camera in the viewfinder; the default macro camera is the first macro camera or the second macro camera.
- the target camera is the main camera.
- the method further includes: if the first shooting distance of the N consecutive frames of images is less than the first threshold, displaying prompt information in the viewfinder, and the prompt information is used to prompt that macro shooting has been entered. model.
- a prompt message is used to remind the user that the user has entered the macro shooting mode, which further improves the macro shooting experience.
- the method further includes: detecting the second shooting distance of the image collected by the current macro camera; if the second shooting distance of the consecutive M frame images is greater than the second threshold, then starting from the current The macro camera switches to the default camera, and the image captured by the default camera is displayed in the viewfinder; the current macro camera is the first macro camera or the second macro camera.
- the default camera can be the main camera or other cameras.
- the viewfinder frame also includes a first shortcut control and a second shortcut control; the first shortcut control is used to switch the picture displayed in the viewfinder frame from the picture captured by the first macro camera to the third shortcut control.
- the picture captured by the second macro camera; the second shortcut control is used to switch the picture displayed in the viewfinder from the picture captured by the second macro camera to the picture captured by the first macro camera.
- the user can quickly switch the macro camera through the shortcut control, further improving the user experience.
- the first shortcut control is a telephoto macro shortcut control
- the second shortcut control is a super wide-angle macro shortcut control.
- embodiments of the present application provide a macro photography method, which is applied to electronic devices.
- the method includes:
- the picture captured by the first macro camera is displayed in the viewfinder, and the navigation window is superimposed on the preview picture displayed in the viewfinder.
- the navigation window is used to display the navigation picture, and the field of view of the navigation picture is larger than the preview. The field of view of the picture.
- the embodiment of the present application superimposes and displays a navigation screen with a larger FOV on the preview screen, which facilitates the user to compose macro shots and find the subject, and improves the user's macro shooting experience.
- the first macro camera is a telephoto macro camera or an ultra-wide-angle macro camera.
- the navigation picture is a picture captured by the first macro camera; or a picture captured by the second macro camera, and the second macro camera has a larger field of view than the first macro camera. angle of view.
- the navigation picture is a picture captured by the first macro camera; the picture captured by the first macro camera is displayed in the viewfinder, and the navigation window is superimposed on the preview picture displayed in the viewfinder.
- image offset cropping is performed on the image collected by the first macro camera to obtain the first cropped image; according to the image offset value, the identification pattern is used to identify The position of the first cropped image in the image collected by the first macro camera is used to obtain the first logo image; the first cropped image is displayed in the viewfinder, and the first logo image is displayed in the navigation window of the viewfinder; wherein, the logo Patterns are used to identify the relative positional relationship between the preview screen and the navigation screen.
- the first macro camera is an ultra-wide-angle macro camera, using the full FOV image captured by the ultra-wide-angle macro camera as the navigation image, and using part of the FOV image captured by the ultra-wide-angle macro camera as the preview image.
- the method also includes:
- the image offset value of the image collected by the macro camera, and the offset value is updated according to the image offset value of the image collected by the first macro camera.
- determining the image offset value of the image collected by the first macro camera according to the first image feature matching result and the zoom magnification of the image collected by the first macro camera includes:
- offset represents the offset value from the center of the field of view of the first macro camera to the center of the field of view of the second macro camera, which is a pre-calibrated offset value , or image feature matching result
- offset pre represents the image offset value of the previous frame image
- offset cur represents the image offset value of the current frame image
- zoom pre represents the zoom magnification of the previous frame image
- zoom cur represents the current frame image
- zoom magnification represents the zoom magnification at the end of the image shift, which is less than or equal to the camera switching magnification
- zoom start represents the zoom magnification at the beginning of the image shift, which is greater than or equal to the minimum zoom magnification of the first macro camera.
- the navigation picture is a picture captured by the second macro camera
- the offset value is the third cropped image obtained by performing image offset cropping on the image collected by the second macro camera; or, the full field of view image collected by the second macro camera.
- the second macro camera is an ultra-wide-angle macro camera
- the first macro camera is a telephoto macro camera
- the telephoto image is used as the preview image
- the full FOV image or part of the FOV captured by the ultra-wide-angle macro camera is used.
- the picture is used as a navigation picture, as long as the FOV of part of the ultra-wide-angle macro camera's FOV picture is larger than that of the telephoto picture.
- the method also includes:
- Offset value updates the offset value.
- the navigation picture is a picture captured by the first macro camera
- the first macro camera is a telephoto macro camera.
- the full FOV picture captured by the telephoto macro camera is used as the navigation picture, and a part of the FOV picture captured by the telephoto macro camera is used as the preview picture.
- the method also includes:
- the image collected by the first macro camera and the image collected by the second macro camera are image fused to obtain a fused image, and the fused image is output;
- the fused image includes the target area and non-targets area, the image quality of the target area is higher than that of the non-target area;
- the target area is the first macro photography The area in the image collected by the camera corresponding to the image collected by the second macro camera.
- the method also includes:
- Detect the first shooting distance of the image collected by the target camera if the first shooting distance of N consecutive frames of images is less than the first threshold, switch from the target camera to the first macro camera, and display the default macro camera capture in the viewfinder picture.
- the method further includes: if the first shooting distance of the N consecutive frames of images is less than the first threshold, displaying prompt information in the viewfinder, and the prompt information is used to prompt that macro shooting has been entered. model.
- the method further includes: detecting the second shooting distance of the image collected by the first macro camera; if the second shooting distance of the consecutive M frame images is greater than the second threshold, then The first macro camera switches to the default camera, and the image captured by the default camera is displayed in the viewfinder.
- embodiments of the present application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor.
- the processor executes the computer program, the above first or second aspects are implemented. The method described in any of the aspects.
- embodiments of the present application provide a computer-readable storage medium.
- the computer-readable storage medium stores a computer program.
- the computer program is executed by a processor, the method of any one of the above-mentioned first or second aspects is implemented.
- inventions of the present application provide a chip system.
- the chip system includes a processor.
- the processor is coupled to a memory.
- the processor executes a computer program stored in the memory to implement any of the above first or second aspects. method described in the item.
- the chip system can be a single chip or a chip module composed of multiple chips.
- embodiments of the present application provide a computer program product, which when the computer program product is run on an electronic device, causes the electronic device to execute the method described in the first or second aspect.
- Figure 1 is a schematic block diagram of the hardware structure of an electronic device 100 provided by an embodiment of the present application.
- Figure 2 is a software structure block diagram of the electronic device 100 provided by the embodiment of the present application.
- Figure 3A is a schematic diagram of manually entering macro shooting mode according to an embodiment of the present application.
- Figure 3B is a schematic diagram of automatically entering the macro shooting mode provided by an embodiment of the present application.
- Figure 3C is a schematic diagram of a prompt to exit the macro shooting mode provided by an embodiment of the present application.
- Figure 3D is a schematic diagram of the zoom process in macro shooting mode provided by an embodiment of the present application.
- Figure 3E is a schematic diagram of a shortcut control provided by an embodiment of the present application.
- Figure 4 is a schematic diagram of the ultra-wide-angle preview process provided by an embodiment of the present application.
- Figure 5 is a schematic diagram of the image navigation process of a single macro camera provided by an embodiment of the present application.
- Figure 6 is a schematic diagram of image navigation for macro photography provided by an embodiment of the present application.
- Figure 7 is a schematic diagram of image navigation provided by an embodiment of the present application.
- Figure 8 is another schematic diagram of image navigation provided by an embodiment of the present application.
- Figure 9 is a schematic diagram of a long-focus, low- and medium-magnification image navigation solution provided by an embodiment of the present application.
- Figure 10 is a schematic flow chart of a long-focus, low- and medium-magnification image navigation solution provided by an embodiment of the present application;
- Figure 11 is another schematic diagram of image navigation provided by an embodiment of the present application.
- Figure 12 is a schematic flow chart of the ultra-wide-angle high-magnification navigation solution provided by the embodiment of the present application.
- Figure 13 is a schematic flow chart of the telephoto high-magnification navigation solution provided by the embodiment of the present application.
- Figure 14 is a schematic diagram of a fused image provided by an embodiment of the present application.
- Figure 15 is a schematic flow chart of macro photography provided by an embodiment of the present application.
- Figure 16A is a schematic diagram of macro photography provided by an embodiment of the present application.
- Figure 16B is another schematic diagram of macro photography provided by an embodiment of the present application.
- Figure 16C is another schematic diagram of macro photography provided by an embodiment of the present application.
- Figure 17A is a schematic diagram of a macro video preview scene provided by an embodiment of the present application.
- Figure 17B is a schematic diagram of macro video recording provided by an embodiment of the present application.
- the macro shooting image is often obtained through digital zoom technology, that is, through the macro
- the images collected by the camera at zoom magnification are cropped, enlarged, and interpolated to obtain macro images at equivalent focal lengths.
- a single macro camera covers a single focal length, and cropped and enlarged images often suffer from image distortion and other problems, resulting in poor image quality and poor macro shooting effects.
- the mobile phone is integrated with an ultra-wide-angle macro camera.
- the ultra-wide-angle macro camera is a fixed-focus camera with a zoom magnification of 0.5x, and the zoom magnification range it can cover is 0.5x ⁇ 15x.
- the mobile phone In the process of macro shooting based on the ultra-wide-angle macro camera of the mobile phone, when the zoom magnification is 0.5x, the mobile phone obtains optical images through the ultra-wide-angle macro camera without digital zoom; when the zoom magnification is greater than 0.5x , after the mobile phone obtains an optical image with a zoom magnification of 0.5x, it digitally zooms the optical image to obtain a macro image at an equivalent focal length. In this case, at a higher zoom magnification, the macro image obtained by digitally zooming the ultra-wide-angle optical image has poor image quality.
- a mobile phone is integrated with a telephoto macro camera.
- the telephoto macro camera is a fixed focus camera with a zoom magnification of 3x, and the zoom magnification range it can cover is 3x to 15x.
- the mobile phone obtains optical images through the telephoto macro camera without digital zoom; when the zoom magnification is greater than 3x, the mobile phone After acquiring an optical image with a zoom magnification of 3x, digitally zoom the optical image to obtain a macro image at an equivalent focal length.
- the zoom magnification is high, the macro image obtained by digital zooming of the telephoto optical image has poor image quality.
- a single telephoto macro camera cannot achieve macro shooting with a focal length below 3x, resulting in a single focal length covered by macro shooting.
- embodiments of the present application provide a macro shooting solution based on at least two macro cameras, so that during the zoom process of macro shooting, at least The switching relay between the two macro cameras enables macro shooting with a wider focal length and improves the macro shooting effect.
- the electronic device is equipped with at least two macro cameras, and the focal lengths of the at least two macro cameras are inconsistent.
- macro shooting mode after the electronic device obtains the current zoom ratio, it can determine which focal length of the macro camera the current zoom ratio falls on, and whether it reaches the focal length of the camera. head to switch magnification. If the current zoom ratio falls into the focal length of a certain macro camera, the electronic device uses the macro camera to perform macro photography. If the current zoom ratio reaches the camera switching ratio, the electronic device switches from the current macro camera to another macro camera and uses the other macro camera for macro shooting; if the current zoom ratio does not reach the camera switching ratio, continue to use it The current macro camera performs macro shooting. In this way, through the switching relay of multiple macro cameras, macro shooting with a wider focal length is achieved, and the macro shooting effect is better.
- macro camera refers to a camera with macro focusing and macro photography capabilities, which may include but is not limited to: ultra-wide-angle macro camera, wide-angle macro camera, and telephoto macro camera.
- the focal lengths of the above-mentioned at least two macro cameras are inconsistent, thereby achieving macro photography at different focal lengths and different zoom magnifications.
- the above-mentioned at least two macro cameras may be fixed focus lenses.
- the electronic device performs discontinuous optical zoom based on at least two fixed-focus macro cameras.
- images at corresponding zoom magnifications are obtained through digital zoom.
- the at least two macro cameras may be continuous zoom lenses, which is not limited here.
- the electronic device includes two fixed-focus cameras.
- One is an ultra-wide-angle macro camera with a zoom ratio of 0.5x, which can cover a zoom ratio of 0.5x to 3.5x; the other is a telephoto macro camera with a zoom ratio of 3.5x, which can cover a range of zoom ratios. It is 3.5x ⁇ 15x.
- the camera switching magnification is 3.5x.
- the electronic device obtains the current zoom ratio during the zoom process of macro shooting. If the current zoom ratio is between 0.5x and 3.5x, the ultra-wide-angle macro camera is used for macro shooting; if the current zoom ratio is 3.5x , it is determined that the zoom magnification reaches the camera switching magnification, and camera switching is performed to switch from the ultra-wide-angle macro camera to the telephoto macro camera. After switching, use the telephoto macro camera for macro shooting; if the current zoom magnification is greater than At 3.5x, the telephoto macro camera is used for macro shooting.
- the electronic device digitally zooms and crops the image collected by the ultra-wide-angle macro camera to obtain the image at the corresponding zoom ratio; if the current zoom ratio is greater than 3.5x , the electronic device digitally zooms and crops the image collected by the telephoto macro camera to obtain the image at the corresponding zoom magnification.
- the macro shooting solution based on at least two fixed-focus macro cameras provided by the embodiment of the present application has a wider focal length covered by the macro shooting, and the micro-photography The distance shooting effect is better.
- the macro shooting solution based on the fixed-focus telephoto macro camera mentioned above can only achieve macro shooting of 3x to 15x, and cannot achieve macro shooting with focal lengths below 3x.
- the embodiment of the present application is based on a 0.5x ultra-wide-angle macro camera and a 3.5x telephoto macro camera, which can achieve 0.5x to 15x macro shooting, and the macro shooting covers a wider focal length.
- the macro shooting solution based on the fixed-focus ultra-wide-angle macro camera mentioned above can achieve macro shooting of 0.5x to 15x, when the zoom magnification is high (such as 10x), it is still limited to 0.5x.
- the wide-angle optical image is digitally zoomed and cropped to obtain a macro image.
- the image quality is poor and the macro shooting effect is poor.
- the 0.5x wide-angle optical image is no longer digitally zoomed and cropped, but the 3.5x telephoto image is Perform digital zoom cropping.
- the zoom magnification is greater than 3.5x, compared with the image obtained by digital zoom cropping of the 0.5x wide-angle optical image, the image obtained by digital zoom cropping of the 3.5x telephoto optical image has better quality. And improve the macro shooting effect.
- focal length refers to the segmentation of the focal length of the lens. Zoom magnification and focal length can be converted into each other.
- the focal length is expressed by zoom magnification above.
- the focal length of an ultra-wide-angle macro camera is 0.5x ⁇ 3.5x, which refers to the focal length range corresponding to a zoom magnification of 0.5x ⁇ 3.5x.
- the focal length corresponding to a zoom magnification of 0.5x is the focal length of the ultra-wide-angle macro camera, and other zooms
- the focal length corresponding to the magnification is the equivalent focal length obtained through digital zoom.
- the electronic device in the embodiment of the present application may be, but is not limited to, a mobile phone, a tablet computer, a notebook computer, etc.
- the embodiment of the present application limits the specific type and structure of the electronic device.
- FIG. 1 is a schematic diagram of the hardware structure of an electronic device 100 according to an embodiment of the present application.
- the electronic device 100 may include a processor 101 , a memory 102 , a focus motor 103 and a macro camera 104 .
- the electronic device 100 may include 1 or N macro cameras 104, where N is a positive integer greater than 1.
- the electronic device 100 may also include other types of cameras.
- the electronic device 100 is a mobile phone and includes an ultra-wide-angle macro camera, a telephoto macro camera, and a main camera.
- the electronic device 100 may also include a sensor module 105.
- the sensor module 105 may include but is not limited to the distance sensor 105A and the like.
- the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 .
- the electronic device 100 may include more or fewer components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently.
- the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
- the electronic device 100 when the electronic device 100 is a mobile phone or a tablet computer, the electronic device 100 may also include a touch screen composed of a display screen and a touch sensor.
- Processor 101 may include one or more processing units.
- the processor 101 may include an application processor (AP), a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, And/or digital signal processor (digital signal processor, DSP), etc.
- AP application processor
- GPU graphics processing unit
- ISP image signal processor
- controller may be the nerve center and command center of the electronic device 100 .
- the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
- processor 101 may include one or more interfaces.
- the interface may include a mobile industry processor interface (MIPI) and/or a general-purpose input/output (GPIO) interface, etc.
- MIPI mobile industry processor interface
- GPIO general-purpose input/output
- the MIPI interface can be used to connect the processor 101 with peripheral devices such as the display screen and camera 104.
- MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
- the processor 101 and the macro camera 104 communicate through the CSI interface to implement the macro shooting function of the electronic device 100 .
- the processor 101 and the display screen communicate through the DSI interface to realize the display function of the electronic device 100 .
- the GPIO interface can be configured through software.
- the GPIO interface can be configured as a control signal or as a data signal.
- the GPIO interface can be used to connect the processor 101 with the macro camera 104, display screen, sensor module 105, etc.
- the GPIO interface can also be configured as a MIPI interface, etc.
- the interface connection relationships between the modules illustrated in the embodiments of this application are only schematic illustrations. It does not constitute a structural limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
- the electronic device 100 can implement the shooting function through an ISP, a macro camera 104, a video codec, a GPU, a display screen, an application processor, and the like.
- the ISP is used to process data fed back by the macro camera 104 .
- the shutter is opened, the light is transmitted to the camera sensor through the lens, the light signal is converted into an electrical signal, and the camera sensor passes the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
- ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
- the ISP may be provided in the macro camera 104.
- Macro camera 104 is used to capture still images or video.
- the object passes through the lens to produce an optical image that is projected onto the photosensitive element.
- the photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
- CMOS complementary metal-oxide-semiconductor
- the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal.
- ISP outputs digital image signals to DSP for processing.
- DSP converts digital image signals into standard RGB, YUV and other format image signals.
- the optical zoom in the embodiment of the present application may also be implemented based on multiple fixed-focus lenses.
- one or more camera modules in the macro camera 104 may include multiple fixed-focus lenses.
- Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals.
- Memory 102 may be used to store computer executable program code, which includes instructions.
- the processor 101 executes instructions stored in the internal memory to execute various functional applications and data processing of the electronic device 100 .
- the memory 102 may include an area for storing programs and an area for storing data.
- the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
- the storage data area may store data created during use of the electronic device 100 (such as audio data, phone book, etc.).
- the internal memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
- the distance sensor 105A is used to measure the distance between the lens and the subject.
- the electronic device 100 can measure distance through an infrared ranging sensor, a laser ranging sensor, or a time of flight (TOF) camera.
- TOF time of flight
- the electronic device 100 can utilize the distance sensor 105A to measure distance to achieve fast focusing.
- the electronic device in a macro shooting scene, can also use the distance sensor 105A to measure distance, so as to realize the function of automatically entering the macro shooting mode and automatically exiting the macro shooting mode.
- the focus motor 103 is used to control the focus module to move within the focus range to achieve focus. Normally, the electronic device 100 zooms first and then focuses. For example, in a macro shooting scene, after entering the macro shooting mode, the electronic device 100 zooms according to the zoom ratio selected by the user, and then focuses after zooming.
- the software architecture of the electronic device 100 is exemplarily introduced below.
- the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
- the embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
- FIG. 2 is a software structure block diagram of the electronic device 100 according to the embodiment of the present application.
- the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
- the layers communicate through software interfaces.
- the Android system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime and system libraries, and kernel layer.
- the application layer can include a series of application packages. As shown in Figure 2, the application package can include camera, gallery, calendar, calling, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
- the application framework layer provides an application programming interface (API) and programming framework for applications in the application layer.
- the application framework layer includes some predefined functions. As shown in Figure 2, the application framework layer can include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
- a window manager is used to manage window programs.
- the window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
- Content providers are used to store and retrieve data and make this data accessible to applications. These data can include videos, images, audio, etc.
- the view system includes visual controls, such as controls that display text, controls that display pictures, etc.
- a view system can be used to build applications.
- the display interface can be composed of one or more views.
- a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
- the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
- the notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
- the notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
- Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
- the core library contains two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Android.
- the application layer and application framework layer run in virtual machines.
- the virtual machine executes the java files of the application layer and application framework layer into binary files.
- the virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
- System libraries can include multiple functional modules. For example: surface manager (surface manager), media libraries (Media Libraries), 3D graphics processing libraries (for example: OpenGL ES), 2D graphics engines (for example: SGL), etc.
- the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
- the media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, composition, and layer processing.
- 2D Graphics Engine is a drawing engine for 2D drawing.
- the kernel layer is the layer between hardware and software.
- the kernel layer at least includes display driver, camera driver, audio driver, sensor driver, and focus motor driver.
- the following exemplifies the workflow of the software and hardware of the electronic device 100 in conjunction with the shooting scene.
- the touch sensor receives a touch operation
- the corresponding hardware interrupt is sent to the kernel layer.
- the kernel layer processes touch operations into raw input events (including touch coordinates, timestamps of touch operations, and other information).
- Raw input events are stored at the kernel level.
- the application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation and the control corresponding to the click operation as a camera application icon control as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer.
- Macro camera 104 captures still images or video.
- the electronic device 100 can first enter the macro shooting mode, and then obtain the current zoom magnification during the zoom process of the macro shooting mode, and adjust the zoom ratio according to the current The zoom magnification determines the macro camera used and whether to switch to a macro camera.
- the electronic device 100 may enter the macro shooting mode in response to a user instruction, the user instruction being used to instruct the electronic device 100 to enter the macro shooting mode. That is, users can manually enter macro shooting mode.
- the electronic device 100 is specifically a mobile phone 31 , and the mobile phone 31 includes a main camera, an ultra-wide-angle macro camera, and a telephoto macro camera.
- the main interface 311 of the mobile phone 31 includes applications such as smart life, settings, calendar, gallery, and camera 312.
- the mobile phone 31 detects the user's click operation on the camera 312
- the mobile phone 31 displays the preview interface 313 in response to the click operation.
- the preview interface 313 displays the picture captured by the main camera, and the picture includes the shooting subject 319 .
- the preview interface 313 includes a zoom bar 314 and a zoom control 315, and also includes controls for various shooting modes, including: aperture mode control, night scene mode control, video recording mode control 316, photography mode control 317, and macro mode control 318.
- Mobile phone 31 is currently in camera mode.
- the current zoom ratio is 1x displayed on the zoom bar 314 .
- the user can drag the zoom control 315 on the zoom bar 314 to change the zoom ratio. Dragging the zoom control 315 to the left can increase the zoom ratio, and dragging the zoom control 315 to the right can decrease the zoom ratio.
- the user can enter the corresponding shooting mode by clicking on the shooting mode control. For example, if the user needs to enter the video recording mode, he can click the video recording mode control 316 to enter the video recording mode.
- the user can manually click the macro mode control 318.
- the mobile phone 31 After detecting a click operation on the macro mode control 318, the mobile phone 31 enters the macro shooting mode in response to the click operation and displays the preview interface 320.
- the above-mentioned user instruction for instructing the electronic device 100 to enter the macro shooting mode is a click instruction for the macro mode control 318 .
- the mobile phone 31 switches from the current photographing mode to the macro shooting mode, and activates the ultra-wide-angle macro camera to obtain the images collected through the ultra-wide-angle macro camera.
- the image data is displayed on the preview interface 320 and the picture captured by the ultra-wide-angle macro camera is displayed. That is, after detecting a click operation on the macro mode control 318, the mobile phone 31 switches from the main camera to the ultra-wide-angle macro camera.
- the telephoto macro camera can also be switched from the main camera by default, that is, after entering the macro shooting mode, the images captured by the telephoto macro camera are displayed on the preview interface 320 .
- the FOV of the image displayed on the preview interface 320 remains unchanged.
- the electronic device 100 may also exit the macro shooting mode in response to a user instruction for instructing to exit the macro shooting mode. That is, users can manually exit macro shooting mode.
- the mobile phone 31 detects the user's click operation on the video recording mode control 316, and then exits the macro shooting mode and enters the video recording mode in response to the click operation on the video recording mode control 316.
- the mobile phone 31 may also provide a control for exiting the macro shooting mode. When a user's click operation on the control is detected, the macro shooting mode is exited in response to the click operation.
- the method of manually exiting macro shooting mode is not limited here.
- the electronic device 100 can also automatically enter and exit the macro shooting mode in other embodiments of the present application. At this time, when the electronic device 100 determines that the conditions for automatically entering the macro photography mode are met, it automatically enters the macro photography mode; when it determines that the conditions for automatically exiting the macro photography mode are met, it automatically exits the macro photography mode.
- the condition for automatically entering the macro shooting mode is: it is detected that the shooting distance of N consecutive frames of images is less than the first threshold.
- the condition for automatically exiting the macro shooting mode is: it is detected that the shooting distance of M consecutive M frames of images is greater than the second threshold.
- N is 30 frames, and the first threshold is 10cm; M is 60 frames, and the second threshold is 50cm.
- the electronic device 100 can perform distance measurement through the distance sensor 105A or TOF to detect the above-mentioned shooting distance.
- the conditions for automatically entering the macro shooting mode and the conditions for automatically exiting the macro shooting mode can also be other, and are not limited here.
- the electronic device 100 may re-detect the shooting distance of the image every preset number of frames (for example, 2 frames), and when the detected shooting distances in the N frames of images are all less than the first threshold, it is determined that the Conditions for automatically entering macro shooting mode. Automatically entering macro shooting mode.
- the electronic device 100 can also detect the shooting distance of the image every preset number of frames (for example, 3 frames), and when the shooting distance detected in the M frames of images is greater than the second threshold, it is determined that the automatic exit from the microprocessor is satisfied. Macro shooting mode will automatically exit macro shooting mode.
- the condition for automatically entering the macro shooting mode is: the shooting distances detected within the first time period are all smaller than the third threshold.
- the condition for automatically exiting the macro shooting mode is: the shooting distance detected in the second time period is greater than the fourth threshold.
- the first time period, the second time period, the third threshold and the fourth threshold can all be set according to actual needs.
- the preview interface 321 is displayed in response to the click operation.
- the preview interface 321 displays the picture captured by the main camera, and the picture includes the shooting subject 319 .
- the mobile phone 31 is currently in the camera mode, that is, the preview interface 321 is the camera preview interface.
- the mobile phone 31 After the mobile phone 31 enters the photo preview state, it detects the distance between the mobile phone 31 and the shooting subject 319, which is the shooting distance, and Determine whether the shooting distance is smaller than the first threshold. If it is detected that the shooting distances of the consecutive N frames of images collected by the main camera are all smaller than the first threshold, the mobile phone 31 determines that the conditions for automatically entering the macro shooting mode are met, and automatically enters the macro shooting mode. After the mobile phone 31 enters the macro shooting mode, it switches from the main camera to the ultra-wide-angle macro camera, and displays the image captured by the ultra-wide-angle macro camera on the preview interface 322 . In addition, in order to remind the user that the macro shooting mode has been entered, the mobile phone 31 also displays a prompt message 323 on the preview interface 322. The prompt message 323 is specifically "macro mode is on", which is used to prompt the user that the macro shooting has been automatically entered. model.
- the user can also be prompted that the macro shooting mode has been entered by other means.
- the mobile phone 31 plays the prompt voice "Macro mode is on" through the speaker.
- the prompting operation can also be used to prompt the user how to operate in the macro shooting mode.
- the mobile phone 31 can also display macro shooting mode operation prompt information on the preview interface 322 .
- the mobile phone 31 may not perform the prompt operation.
- the electronic device 100 may also first perform a prompt operation to prompt the user whether to enter the macro photography mode; after receiving the user's confirmation to enter the macro photography mode, After the command, enter the macro shooting mode.
- a prompt operation to prompt the user whether to enter the macro photography mode; after receiving the user's confirmation to enter the macro photography mode, After the command, enter the macro shooting mode.
- the mobile phone 31 pops up a prompt window on the preview interface 321.
- the prompt window includes two option buttons, "Yes" and "No", and a prompt.
- the message “It is currently detected that the conditions are met, whether to enter the macro shooting mode”; when the mobile phone 31 detects a click operation on the "Yes” option button, it enters the macro shooting mode in response to the click operation.
- FIG. 3A and FIG. 3B are as mentioned above and will not be described again here.
- the macro shooting mode is not set as a shooting mode in parallel with the photo taking, video recording and other modes, but the macro shooting mode is set in the photo taking mode.
- a macro shooting mode is set separately, and the macro shooting mode is parallel to the photo mode, video mode and other modes.
- both methods of Figure 3A and Figure 3B can be used, that is, the macro shooting function can be set as a shooting mode alone, or the macro shooting function can be set in other shooting modes, which is not limited here. .
- the mobile phone 31 After automatically entering the macro shooting mode, the mobile phone 31 continues to detect the shooting distance from the shooting subject 319 through a distance sensor or TOF, and determines whether the shooting distance is greater than the second threshold. If it is detected that the shooting distance of the consecutive M frame images collected by the macro camera is greater than the second threshold, the mobile phone 31 determines that the conditions for automatically exiting the macro shooting mode are met, and automatically exits the macro shooting mode.
- the electronic device 100 when it automatically exits the macro shooting mode, it can display corresponding prompt information on the preview interface to remind the user that the macro shooting mode has currently been exited.
- a prompt to exit the macro shooting mode shown in FIG. 3C For example, refer to a schematic diagram of a prompt to exit the macro shooting mode shown in FIG. 3C.
- the mobile phone 31 Based on the scene in FIG. 3B, the mobile phone 31 is in the macro shooting mode. After it is determined that the conditions for automatically exiting the macro shooting mode are met, the mobile phone 31 automatically Exit the macro shooting mode, and display prompt information 325 on the preview interface 324 to remind the user that the macro shooting mode is currently turned off.
- Prompt message 325 is specifically “Macro mode is turned off”.
- the same parts of Fig. 3C as Fig. 3A and Fig. 3B can be referred to above and will not be described again here.
- the electronic device 100 when the electronic device 100 exits the macro shooting mode, it can determine the focal length of the camera to be used after exiting the macro shooting mode based on the current zoom magnification.
- the electronic device 100 includes a main camera, a telephoto macro camera, and an ultra-wide-angle macro camera.
- a telephoto macro camera refers to a telephoto camera with macro photography capabilities
- an ultra-wide-angle macro camera refers to an ultra-wide-angle camera with macro photography capabilities
- the electronic device 100 when the electronic device 100 exits the macro shooting mode, it can also return to the default focal length and default camera.
- the default focal length is the focal length of the main camera
- the default camera is the main camera, that is, no matter which focal length the current zoom magnification is when exiting macro shooting mode
- the default focal length is the focal length of the main camera when exiting macro shooting mode. , automatically switches to the main camera and the focal length of the main camera.
- the electronic device 100 can enter and exit the macro shooting mode manually, and can also enter and exit the macro shooting mode automatically. In comparison, the electronic device 100 determines whether to automatically enter and exit the macro photography mode based on the shooting distance, which makes the operation more convenient and the user's macro photography experience better. Furthermore, when entering and/or exiting the macro photography mode, prompt information is used to remind the user that the user has entered and exited the macro photography mode, and the user's macro photography experience is also higher.
- the electronic device 100 may be in the macro shooting mode by default, that is, the electronic device 100 does not need to enter the macro shooting mode from another shooting mode.
- the electronic device 100 after entering the macro shooting mode, the electronic device 100 obtains the current zoom magnification, and determines whether the current zoom magnification reaches the camera switching magnification according to the focal length of the macro camera; if the current zoom magnification reaches the camera switching magnification, Then switch the macro camera to achieve macro photography with a wider focal length.
- the zoom ratio may be obtained through human-computer interaction, that is, the zoom ratio is input by the user; it may also be determined independently by the electronic device 100 .
- the mobile phone 31 automatically enters the macro shooting mode after determining that the conditions for automatically entering the macro shooting mode are met.
- the preview The screen captured by the ultra-wide-angle macro camera is displayed on the interface 322, and a prompt message 323 is also displayed on the preview interface 322 to remind the user that the macro mode is turned on.
- the user can change the zoom ratio by dragging the zoom control 315 on the zoom bar 314 .
- the zooming process if the current zoom ratio reaches the camera magnification switching ratio, the photo preview screen of the mobile phone 31 switches from the ultra-wide-angle macro camera to the telephoto macro camera, or switches from the telephoto macro camera to the ultra-wide-angle macro camera. .
- the ultra-wide-angle macro camera and telephoto macro camera mentioned below are fixed-focus cameras, and the zoom magnification range covered by the ultra-wide-angle macro camera is 0.5x ⁇ 3.5 x, the range includes 0.5x, excluding 3.5x; the zoom magnification range covered by the telephoto macro camera is 3.5x ⁇ 15x, and the range includes 3.5x.
- the camera switching magnification is 3.5x.
- the zoom magnification range supported by the ultra-wide-angle macro camera and telephoto macro camera is not limited to the range mentioned above.
- the current zoom magnification displayed on the preview interface 322 is 1x.
- the user drags the zoom control 315 to the right to increase the zoom ratio to 1.5x.
- the mobile phone 31 obtains the current zoom magnification of 1.5x, and determines that the current zoom magnification of 1.5x does not reach the camera switching magnification of 3.5x.
- the current zoom ratio of 1.5x falls into the focal length of the ultra-wide-angle macro camera, so when the zoom ratio increases from 1x to In the process of 1.5x, the mobile phone 31 does not need to switch the macro camera, and still uses the ultra-wide-angle macro camera for macro shooting.
- the mobile phone 31 digitally zooms and crops the image captured by the ultra-wide-angle macro camera to obtain a display image, and displays the display image on the preview interface 326 to display the image captured by the ultra-wide-angle macro camera on the preview screen 326 picture.
- the mobile phone 31 After the user increases the zoom ratio to 1.5x, the user continues to drag the zoom control 315 to the right to increase the zoom ratio from 1.5x to 3.5x. In response to the user's drag operation on the zoom control 315, the mobile phone 31 obtains the current zoom magnification of 3.5x. The mobile phone 31 determines that the current zoom magnification of 3.5x has reached the camera switching magnification and needs to perform a switching relay of the macro camera. Then it switches from the ultra-wide-angle macro camera to the telephoto macro camera and uses the telephoto macro camera for macro shooting. Specifically, the mobile phone 31 displays the image captured by the telephoto macro camera on the preview interface 327 according to the current zoom ratio. In this way, when the zoom magnification reaches the camera switching magnification, the picture displayed on the preview interface of the mobile phone 31 switches from the ultra-wide-angle macro camera to the telephoto macro camera.
- the mobile phone 31 After the user increases the zoom ratio to 3.5x, the user continues to drag the zoom control 315 to the right to increase the zoom ratio from 3.5x to 4.0x. In response to the user's drag operation on the zoom control 315, the mobile phone 31 obtains the current zoom magnification of 4.0x. The mobile phone 31 determines that the current zoom magnification of 4.0x does not reach the camera switching magnification, and there is no need to perform macro camera switching relay, so it continues to use the telephoto macro camera for macro shooting.
- the mobile phone 31 digitally zooms and crops the image collected by the telephoto macro camera according to the current zoom magnification, obtains the transmitted image, and displays the transmitted image on the preview interface 328 to display the telephoto image on the preview interface 328 Picture captured by macro camera.
- the current zoom ratio is also displayed on the preview interface 328 and the preview interface 327 .
- the mobile phone 31 realizes mobile phone macro photography from the ultra-wide-angle focal length to the telephoto focal length through the switching relay between the ultra-wide-angle macro camera and the telephoto macro camera.
- camera switching in addition to camera switching by dragging the zoom control 315, camera switching can also be performed by shortcut controls.
- the mobile phone 31 displays prompt information 323 on the preview interface 329 , and switches from the main camera to
- the ultra-wide-angle macro camera uses the ultra-wide-angle macro camera for macro shooting, that is, the picture captured by the ultra-wide-angle macro camera is displayed on the preview interface 329 .
- the preview interface 329 also includes a super wide-angle macro shortcut control 330 and a telephoto macro shortcut control 331 . If the user needs to enter the ultra-wide-angle macro mode, he can click the ultra-wide-angle macro shortcut control 330; if he needs to enter the telephoto macro mode, he can click the telephoto macro shortcut control 331. Among them, in the ultra-wide-angle macro mode, the ultra-wide-angle macro camera is used for macro photography; in the telephoto macro mode, the telephoto macro camera is used for macro photography.
- the mobile phone 31 after determining that the conditions for automatically entering the macro shooting mode are met, the mobile phone 31 automatically enters the macro shooting mode, and when automatically entering the macro shooting mode, it enters the ultra-wide-angle macro mode by default.
- the super wide-angle macro shortcut control 330 in the preview interface 329 is in an open state
- the telephoto macro shortcut control 331 is in a closed state.
- a shadow is added to the shortcut control to represent the closed state of the shortcut control, and no shadow is attached to the shortcut control to represent the open state of the shortcut control.
- the on state and the off state can also be distinguished in other ways, for example, Different colors can be used to indicate the on and off states respectively.
- the specific expression form of the shortcut control is not limited to that shown in Figure 3D, and is not limited here.
- the display position of the shortcut control is not limited to that shown in FIG. 3D.
- the telephoto and macro shortcut control can be displayed on the zoom bar 314 and be at a position with a zoom magnification of 3.5x, which is not limited here.
- the user can click the telephoto macro shortcut control 331 to switch from the ultra-wide-angle macro mode to the telephoto macro mode.
- the mobile phone 31 responds to the click operation by increasing the zoom magnification from 1x to 3.5x and switching from the ultra-wide-angle macro camera to the telephoto camera.
- the telephoto macro camera is used for macro shooting, that is, the picture captured by the telephoto macro camera is displayed on the preview interface 332 .
- the ultra-wide-angle macro shortcut control 330 on the preview interface 332 is in a closed state, and the telephoto macro shortcut control 331 is in an open state.
- the mobile phone 31 switches to the telephoto macro mode, if the user needs to switch to the ultra-wide-angle macro mode, he can also click the ultra-wide-angle macro shortcut control 330 to quickly switch from the telephoto macro mode to the ultra-wide-angle macro mode. .
- the mobile phone 31 can also exit the macro shooting mode through the ultra-wide-angle macro shortcut control 330 .
- the mobile phone 31 is in the ultra-wide-angle macro mode, that is, the ultra-wide-angle macro shortcut control 330 is on and the telephoto macro shortcut control 331 is off.
- the user can click the ultra-wide-angle macro shortcut control 330 to exit the micro mode. distance shooting mode.
- the user can also change the zoom ratio by dragging the zoom control 315 .
- the mobile phone 31 determines that the current zoom ratio 3.5x reaches the camera switching ratio, and then switches from the ultra-wide-angle macro camera to the telephoto macro camera, using the telephoto macro
- the camera performs macro photography, displays the telephoto macro shortcut control 331 in an open state, and displays the ultra-wide-angle macro shortcut control 330 in an off state.
- the zoom process in the macro shooting mode is similar to the zoom process of the two macro cameras in the above example, that is, when the zoom magnification reaches the camera switching magnification , then the macro camera switching relay is performed; when the zoom magnification does not reach the camera switching magnification, the macro camera with the corresponding focal length of the zoom magnification is used for macro shooting.
- the macro photography solution based on at least two macro cameras realizes micro photography with a wider focal length through the switching relay of at least two macro cameras during the zoom process of the macro photography mode. Close-up photography, macro photography is more effective.
- embodiments of the present application provide an image center alignment solution.
- the image center alignment solution is used in micro cameras.
- perform image offset cropping on the image collected by the first target macro camera according to the image offset value obtain the cropped image, and use the cropped image as the sent display image;
- the image offset value between the image center of the first target macro camera and the image center of the second target macro camera is calculated, and the offset value is updated based on the image offset value.
- image offset cropping is performed through the image offset value, so that the center of the cropped image and the center of the image collected by the second target macro camera gradually approach each other during the zoom process, and the first target macro camera is switched to the second target macro camera.
- the center of the field of view of the displayed image remains unchanged, and the picture transition is smoother and more natural.
- the two macro cameras involved in the macro camera switching process are defined as the first target macro camera and the second target macro camera.
- the first target macro camera refers to the macro camera with the focal length corresponding to the current zoom magnification, that is, the macro camera currently in use.
- the second target macro camera refers to the macro camera that needs to be switched, that is, it needs to be switched from the first target macro camera to the second target macro camera.
- the focal length of the second target macro camera is adjacent to the focal length of the first target macro camera.
- the focal length of the first target macro camera is smaller than the focal length of the second target macro camera.
- the electronic device 100 After entering the macro shooting mode, the electronic device 100 turns on the first target macro camera and the second target macro camera, and acquires images collected by the first target macro camera and the second target macro camera.
- the image offset value is the initial image offset value, which is pre-calibrated.
- the electronic device 100 performs image offset cropping on the image collected by the first target macro camera according to the initial image offset value to obtain a cropped image; and then uses the cropped image as a display image, that is, displays the cropped image in the preview interface, and based on Match the image features between the cropped image and the image collected by the second target macro camera to obtain the image feature matching result; then determine the image offset value of the current frame image based on the image feature matching result, and determine the image offset value of the current frame image based on the image feature matching result. , update the image offset value.
- the current frame image is an image collected by the first target macro camera.
- Offset value update means using the calculated image offset value as the new image offset value.
- the image offset value is the last updated image offset value.
- the electronic device 100 performs image offset cropping on the image collected by the first target macro camera according to the updated image offset value to obtain a cropped image; and uses the cropped image as a display image, that is, displayed on the preview interface. Crop the image, and perform image feature matching based on the cropped image and the image collected by the second target macro camera, and then determine the image offset value of the current frame image based on the image feature matching results; then based on the image offset value of the current frame image, Update the image offset value. This cycle continues until the zoom magnification reaches the camera switching magnification, and then the displayed image is replaced from the cropped image to the image collected by the second target macro camera.
- the Nth frame image of the first target macro camera perform image offset cropping on the Nth frame image according to the last updated image offset value to obtain the Nth frame image.
- the corresponding display image and, based on the display image corresponding to the N-th frame image and the image collected by the second target macro camera, image feature matching is performed to calculate the image offset value corresponding to the N-th frame image, and The image offset value is updated to the image offset value corresponding to the Nth frame image.
- the last updated image offset value is the image offset value corresponding to the N-1th frame image.
- image offset cropping does not need to be performed on every frame.
- the image feature matching method can be but is not limited to scale-invariant feature transformation (Scale-invariant feature transformation).
- Scale-invariant feature transformation Scale-invariant feature transformation
- Feature transform SIFT
- FLANN Fast Library for Approximate Nearest Neighbors
- ORB Oriented Fast and Rotated Brief
- the cropped image and the image collected by the second macro camera can be down-sampled, and then the down-sampled reduced image can be used for image feature matching.
- the image offset value of the current frame image is calculated by the following formula 1.
- offset represents the offset value from the center of the field of view of the first target macro camera to the center of the field of view of the second target macro camera. Its initial value is obtained from pre-calibrated data, and will be updated in real time to be calculated by the image feature matching algorithm. the value obtained.
- offset pre represents the image offset value of the previous frame image
- offset cur represents the image offset value of the current frame image.
- zoom pre represents the zoom ratio of the previous frame image
- zoom cur represents the zoom ratio of the current frame image.
- zoom end indicates the zoom magnification at which the image offset ends, which needs to be less than or equal to the switching magnification of the first target macro camera and the second target macro camera.
- zoom start indicates the zoom magnification at which image offset begins. Both zoom start and zoom end are preset values. zoom start is greater than or equal to the minimum zoom magnification of the first target macro camera, and less than zoom end . When the zoom ratio is greater than zoom end , the image offset value is offset.
- the electronic device 100 is specifically a mobile phone 31, and the mobile phone 31 includes a main camera, a telephoto macro camera and an ultra-wide-angle macro camera.
- the above-mentioned first target macro camera is a super wide-angle macro camera with a focal length of 0.5x ⁇ 3.5x;
- the above-mentioned second target macro camera is a telephoto macro camera with a focal length of 3.5x ⁇ 15x.
- the camera switching magnification is 3.5x.
- the zoom start is 1x and the zoom end is 3.5x.
- the mobile phone 31 detects that the shooting distance of the consecutive N frames of images is less than the first threshold, then determines that the conditions for automatically entering the macro shooting mode are met, and automatically enters the macro shooting mode, turning on the telephoto macro camera and
- the ultra-wide-angle macro camera collects telephoto images through the telephoto macro camera, and collects wide-angle images through the ultra-wide-angle macro camera.
- the image offset value is the initial offset value.
- a downsampled telephoto reduced image is output.
- the ISP module will perform image offset cropping based on the zoom magnification and image offset value to obtain a cropped image.
- the initial offset value perform image offset cropping on the wide-angle image to obtain the cropped image, and use the cropped image as a wide-angle preview image with a zoom magnification of 1x. That is, the cropped image is displayed on the preview interface 322.
- the mobile phone 31 will also crop the image for downsampling to obtain the wide-angle reduced image, and match the image features between the telephoto reduced image and the wide-angle reduced image. Based on the image feature matching, calculate the distance between the telephoto image center and the wide-angle image center. The image offset value, and then the offset value is updated according to the image offset value.
- the mobile phone 31 executes the process of Figure 4 for each frame of image.
- the mobile phone 31 downsamples the telephoto image through the ISP to obtain the telephoto reduced image; according to the updated image offset value, performs image offset cropping on the wide-angle image to obtain the cropped image.
- Image the cropped image is displayed in the preview interface 326; the cropped image is also downsampled to obtain a wide-angle reduced image; and then the wide-angle reduced image and the telephoto reduced image are matched with image features, and based on the image feature matching result and the current zoom magnification, through
- the above equation 1 calculates the image offset value of the current frame image, and updates the offset value according to the image offset value of the current frame image.
- the mobile phone 31 determines that the current zoom magnification reaches the camera switching magnification, and then uses the telephoto image as the sent display image, that is, the telephoto image is displayed on the preview interface 327 to change the preview interface image from Switch from ultra-wide-angle macro camera to telephoto macro camera.
- the wide-angle image is offset-cropped through the image offset value during super-wide-angle preview, and the registration offset is performed to the telephoto FOV through FOV offset cropping, so that the telephoto
- the FOV should be as close as possible to the center of the ultra-wide-angle cropped FOV, so that when switching from the wide-angle focal length to the telephoto focal length, the image transition will be smoother and more natural, and the user's macro shooting experience will be better.
- the electronic device 100 does not need to calculate the image offset value of the current frame image, and does not need to perform image offset cropping based on the image offset value. .
- the electronic device 100 can directly use the full FOV image or part of the FOV image of the current macro camera as the display image.
- the shooting distance between the camera and the subject is relatively close.
- the zoom magnification is large or in a high focal length, the preview FOV is small, making the user's observation field easily blocked by the electronic device 100 .
- the screen is blocked, and it is easy to lose the subject when shaking, which makes the interaction and composition of macro photography difficult, affecting the user experience.
- embodiments of the present application superimpose and display the image navigation screen on the preview screen in macro shooting mode, and the FOV of the image navigation screen is larger than the FOV of the preview screen. In this way, through the image navigation screen with a larger FOV, it is convenient for users to find macro shooting subjects and adjust the composition. User interaction and composition are more convenient, and the macro shooting experience is better.
- the image navigation screen and the preview screen may be images collected by the same macro camera.
- the electronic device 100 may include at least one macro camera.
- the electronic device 100 can use the full FOV picture captured by the macro camera as the image navigation picture, and use the partial FOV picture cropped from the full FOV picture as the preview picture, thereby making the FOV of the image navigation picture larger than the FOV of the preview picture.
- the electronic device 100 can also use the partial FOV picture captured by the macro camera as the image navigation picture, as long as the field of view angle of the partial FOV picture corresponding to the navigation picture is larger than the field of view angle of the partial FOV picture corresponding to the preview picture.
- the electronic device 100 turns on the macro camera and acquires the image captured by the macro camera; through the ISP Image cropping is performed on the full FOV image captured by the macro camera to crop out part of the FOV image from the full FOV image, and the cropped part of the FOV image is used as a preview screen; the full FOV image captured by the macro camera is also processed through ISP. Downsampling is performed to obtain the reduced image output by the ISP, and the position of the partial FOV image is marked in the reduced image according to the position of the partial FOV image in the full FOV image.
- the position of the partial FOV image in the full FOV image can be obtained by the image cropping process; the marked reduced image is used as the navigation screen; finally, the preview screen and the navigation screen are overlaid and displayed.
- the mobile phone 61 is in the macro shooting mode, displays the photo preview screen 611 , and displays the navigation window 612 superimposed on the photo preview screen 611 .
- the navigation window 612 is used to display the navigation screen, and the position of the preview screen 611 in the full FOV image is marked on the navigation screen by a mark box 613 .
- the zoom magnification in FIG. 6 is Ax, and the value of A is arbitrary.
- the user can know the position of the preview screen 611 in the full FOV image, which facilitates the user to adjust the macro composition and find the macro subject.
- the electronic device 100 can overlay and display the navigation screen on the preview screen only when the zoom ratio is large or the focal length is high.
- the mobile phone 61 includes a telephoto macro camera.
- the value of A is greater than 10, that is, the current zoom magnification is greater than 10x and is at a high telephoto magnification. That is, when the mobile phone 61 is in the high focal length, it is superimposed on the preview screen.
- Navigation screen when the mobile phone 61 is in the high focal length, it is superimposed on the preview screen.
- the mobile phone 61 in Figure 6 includes an ultra-wide-angle macro camera, and the value of A is between 1.5 and 3.5, that is, the current zoom magnification is between 1.5x and 3.5x, which belongs to the high-magnification focal length of the ultra-wide-angle macro camera.
- electronic equipment 100 can also ignore the zoom magnification and focal length values, and display the navigation screen superimposed on the preview screen after entering the macro shooting mode.
- the electronic device when the image navigation screen and preview screen are captured by the same macro camera, if the electronic device includes at least two macro cameras, the electronic device can not only perform camera macro switching relay based on at least two macro cameras. , to achieve macro shooting with a wider focal length, and during the zoom process of macro shooting, image navigation can also be performed based on a single macro camera.
- the electronic device 100 uses the partial FOV image of the currently used macro camera as the preview image, and uses the full FOV image of the macro camera as the preview image.
- electronic devices include telephoto macro cameras and ultra-wide-angle macro cameras.
- the electronic device uses the ultra-wide-angle macro camera for macro shooting, uses part of the FOV image captured by the ultra-wide-angle macro camera as a preview image, and uses the full FOV image captured by the ultra-wide-angle macro camera. screen as a navigation screen.
- the zoom magnification is greater than 3.5x, after the electronic device switches from the ultra-wide-angle macro camera to the telephoto macro camera, the telephoto macro camera is used for macro shooting, and part of the FOV images captured by the telephoto macro camera are used as Preview the screen and use the full FOV screen captured by the telephoto macro camera as the navigation screen.
- the image navigation screen and the preview screen may not be images collected by the same macro camera, and the FOV of the macro camera of the image navigation screen may be greater than the FOV of the macro camera of the preview screen.
- the electronic device 100 may include at least two macro cameras.
- a mobile phone includes an ultra-wide-angle macro camera and a telephoto macro camera.
- the FOV of the ultra-wide-angle macro camera is larger than that of the telephoto macro camera.
- the picture captured by the ultra-wide-angle macro camera is used as the image navigation picture, and the telephoto macro camera is used as the image navigation picture. from camera capture
- the screen is used as the preview screen.
- the FOV of the macro camera of the navigation picture can also be smaller than the FOV of the macro camera of the preview picture.
- the image can be cropped to ensure that the FOV of the image navigation picture is larger than the FOV of the preview picture. That is, the full FOV picture captured by the macro camera corresponding to the navigation picture is cropped to obtain the cropped image corresponding to the navigation picture; the full FOV picture captured by the macro camera corresponding to the preview picture is cropped to obtain the cropped image corresponding to the preview picture; The FOV of the cropped image corresponding to the navigation screen is greater than the FOV of the cropped image corresponding to the preview screen.
- the electronic device 100 can perform a switching relay based on at least two macro cameras during the zoom process of the macro shooting mode. In this way, it not only realizes macro photography with a wider focal length, but also improves the convenience of users to adjust macro composition and find the subject of macro photography through the image navigation screen with a larger FOV.
- the electronic device 100 is a mobile phone 71
- the mobile phone 71 includes a main camera, a telephoto macro camera, and an ultra-wide-angle macro camera.
- the mobile phone 71 displays a photo preview interface 712 in response to the click operation.
- the photo preview interface 712 includes a photo subject 713, a zoom bar 714 and a zoom control 715.
- the photo preview interface 712 displays the picture captured by the main camera, which is a preview picture, and the current zoom ratio is 1x.
- the mobile phone 71 detects the distance to the photographing subject 713 .
- the mobile phone 71 confirms that the conditions for automatically entering the macro shooting mode are met, automatically enters the macro shooting mode, and displays the photo preview interface 716 .
- the photo preview interface 716 displays the picture captured by the ultra-wide-angle macro camera.
- the photo preview interface 716 includes a super wide-angle macro shortcut control 717, a telephoto macro shortcut control 718, and prompt information 719.
- the ultra-wide-angle macro camera is used by default, the ultra-wide-angle macro shortcut control 717 is on, and the telephoto macro shortcut control 718 is off.
- the mobile phone 71 can continuously display the prompt information 719 in the macro shooting mode, or can cancel the display of the prompt information 719 after continuing to display the prompt information 719 for a period of time.
- the user drags the zoom control 715 to the right to increase the zoom ratio from 1x to 3.5x.
- the user can also click the telephoto macro shortcut control 718 to quickly switch to the telephoto macro.
- the mobile phone 71 determines that the current zoom magnification is 3.5x, and when the camera switching magnification is reached, the photo preview interface 720 is displayed.
- the photo preview interface 720 displays the picture captured by the telephoto macro camera. That is, when the camera switching magnification is reached, the photo preview screen of the mobile phone 71 switches from the screen captured by the ultra-wide-angle macro camera to the screen captured by the telephoto macro camera. In this way, through the switching of the ultra-wide-angle macro camera and the telephoto macro camera Relay, realizing macro photography from ultra-wide-angle focal length to telephoto focal length.
- the mobile phone 71 switches from the ultra-wide-angle macro camera to the telephoto macro camera, it switches from the ultra-wide-angle macro mode to the telephoto macro mode. Therefore, when the zoom magnification reaches 3.5x, the ultra-wide-angle macro shortcut control 717 on the photo preview interface 720 is in a closed state, and the telephoto macro shortcut control 718 is in an open state.
- a navigation window 721 is superimposed on the photo preview interface 720, and the navigation window 721 is used to display the navigation screen. Furthermore, a rectangular frame 722 is used to mark the position of the preview screen in the navigation screen.
- the navigation picture displayed in the navigation window 721 is an interface captured by the ultra-wide-angle macro camera.
- the full FOV picture captured by the ultra-wide-angle macro camera can be used as the navigation picture, or the full FOV picture captured by the ultra-wide-angle macro camera can be cropped. After arriving at a suitable field of view (for example, 78°), the cropped image is used as the navigation screen.
- the mobile phone 71 can obtain the position of the preview image in the ultra-wide-angle image by calculating the image offset value between the center of the telephoto image and the center of the ultra-wide-angle image, and pass the rectangular frame 722 Identifies the relative positional relationship between the preview screen and the ultra-wide-angle image.
- the mobile phone 71 can obtain the position of the preview image in the ultra-wide-angle image by calculating the image offset value between the center of the telephoto image and the center of the ultra-wide-angle image, and pass the rectangular frame 722 Identifies the relative positional relationship between the preview screen and the ultra-wide-angle image.
- FOV i.e. an ultra-wide-angle macro camera
- the electronic device 100 may also perform switching relay without at least two macro cameras. At this time, after entering the macro shooting mode, the electronic device 100 only uses one macro camera for macro photography. It does not need to perform macro camera switching relay based on multiple macro cameras, but uses a macro camera with a larger FOV. Perform image navigation.
- the electronic device 100 is a mobile phone 81
- the mobile phone 81 includes a main camera, a telephoto macro camera, and an ultra-wide-angle macro camera.
- the telephoto macro camera is only used for macro photography, and the ultra-wide-angle macro camera is not used for macro photography, but is only used for image navigation.
- a photo preview interface 812 is displayed, and a preview screen is displayed on this interface.
- the photo preview interface 812 includes a photo subject 813, a zoom bar 814 and a zoom control 815. At this time, the photo preview interface 812 displays the image captured by the main camera, and the current zoom magnification is 1x.
- the mobile phone 81 detects the distance between the mobile phone 81 and the photographing subject 813 .
- the mobile phone 81 confirms that the conditions for automatically entering the macro shooting mode are met, automatically enters the macro shooting mode, and displays the photo preview interface 816 .
- the photo preview interface 816 displays the picture captured by the telephoto macro camera.
- the photo preview interface 816 includes prompt information 817, a navigation window 818 and a rectangular frame 819.
- the navigation window 818 is used to display the navigation picture, and at this time the navigation picture is the picture captured by the ultra-wide-angle macro camera.
- the mobile phone 81 obtains the position of the preview screen in the image navigation screen by calculating the image offset value between the center of the ultra-wide-angle image and the center of the telephoto image, and identifies the relative position between the preview screen and the navigation screen through the rectangular frame 819 relation.
- the navigation solution based on at least two cameras with different FOVs can be applied to the macro shooting mode, and when applied to the macro shooting mode, the at least two cameras can include part of the macro shooting mode.
- the electronic device includes a telephoto macro camera and a wide-angle camera.
- the telephoto macro camera is used for macro photography
- the wide-angle camera is used for image navigation. That is, the picture captured by the telephoto macro camera is used as a preview picture.
- the picture captured by the wide-angle camera is used as a navigation picture; it can also be applied to non-macro shooting mode.
- At least two cameras with different FOVs may not be macro cameras.
- the phone in normal photo mode, can use the telephoto camera when the zoom ratio reaches 15x.
- the captured image is used as a preview image, and a navigation window is superimposed on the photo preview interface.
- the navigation image displayed in the navigation window is the image captured by the ultra-wide-angle camera.
- the logo pattern used to mark the gap between the preview screen and the navigation screen is not limited to the rectangular frame mentioned above, and the display position of the logo pattern is not limited to the above-mentioned position. This does not apply here.
- the logo pattern and the display position and display method of the logo pattern are limited.
- the image navigation scheme based on the above-mentioned at least two macro cameras does not need to perform image offset cropping through the above-mentioned image center alignment scheme when switching relays based on at least two macro cameras.
- the picture transition is not smooth and natural.
- the electronic device 100 when switching relays based on at least two macro cameras, in order to ensure a smoother and more natural picture transition when switching cameras, the electronic device 100 can also be aligned through the above-mentioned image center. Solution, image offset cropping is performed based on the image offset value.
- the electronic device 100 uses the first macro camera to perform macro shooting by default, and displays the image captured by the first macro camera on the preview interface as a preview image. It can be understood that the electronic device 100 can superimpose and display the navigation screen on the preview screen after entering the macro shooting mode; it can also superimpose and display the navigation screen on the preview screen when the zoom magnification reaches the target magnification. The latter is used as an example for introduction and explanation below.
- the electronic device 100 obtains the current zoom magnification, determines whether the current zoom magnification reaches the camera switching magnification, and whether it reaches the target magnification; if the current zoom magnification reaches the camera switching magnification, and reaches the target magnification, then from The first macro camera is switched to the second macro camera, that is, the preview screen is switched from the first macro camera to the second macro camera, and the screen captured by the first macro camera is superimposed on the preview screen as an image navigation picture.
- the FOV of the first macro camera is greater than the FOV of the second macro camera.
- the image center alignment scheme described above can also be used to calculate the image offset value between the image center of the first macro camera and the image center of the second macro camera at the current zoom magnification. , and according to the image offset value, identify the relative position relationship between the navigation screen and the preview screen, and also perform image offset cropping on the image captured by the first macro camera based on the image offset value, and use the obtained cropped image as a feed Display preview images to ensure a more natural and smooth transition when switching from the first macro camera to the second macro camera.
- the electronic device 100 is a mobile phone 91, and the mobile phone 91 includes a main camera, a telephoto macro camera, and an ultra-wide-angle macro camera.
- the target magnification is 3.5x.
- a photo preview interface 912 is displayed.
- the photographing preview interface 912 includes a zoom bar 914 and a zoom control 915, as well as a photographing subject 913.
- the photo preview interface 912 displays the image captured by the main camera, and the current zoom magnification is 1x.
- the mobile phone 91 detects the distance between the mobile phone 91 and the photographing subject 913 .
- the mobile phone 91 confirms that the conditions for automatically entering the macro shooting mode are met, automatically enters the macro shooting mode, and displays the photo preview interface 916 .
- the photo preview interface 916 includes a super wide-angle macro shortcut control 917, a telephoto macro shortcut control 918, and prompt information 919.
- the ultra-wide-angle macro camera is used by default, and the ultra-wide-angle macro shortcut control 917 is turned on. state, the telephoto and macro shortcut control 918 is in a closed state.
- the mobile phone 91 After entering the macro shooting mode, the mobile phone 91 turns on the ultra-wide-angle macro camera and the telephoto macro camera to obtain the ultra-wide-angle image captured by the ultra-wide-angle micro camera and the telephoto image captured by the telephoto macro camera.
- the mobile phone 91 When just entering the macro shooting mode, the mobile phone 91 performs image offset cropping on the image collected by the ultra-wide-angle macro camera according to the initial offset value to obtain a cropped image, and uses the cropped image as a sent image, that is, the cropped image Displayed in the photo preview interface 916, that is, after the mobile phone 91 enters the macro shooting mode, the preview screen switches from the screen captured by the main camera to the screen captured by the ultra-wide-angle macro camera.
- the user can drag the zoom control 915 on the zoom bar 914 to change the zoom ratio.
- the mobile phone 91 obtains the current zoom ratio in real time and determines whether the current zoom ratio reaches the camera switching ratio and whether it reaches the target ratio.
- the mobile phone 91 displays a photo preview interface 916.
- the photo preview interface 916 displays the current zoom ratio of 1x.
- the user drags the zoom control 915 to the right to zoom the zoom ratio from 1x to 1.5x, and displays the photo preview interface 920 .
- the zoom magnification has not yet reached the camera switching magnification and target magnification, and the mobile phone 91 continues to use the ultra-wide-angle macro camera for macro photography.
- the mobile phone 91 performs an image center alignment scheme during the zoom process to crop the display image.
- the mobile phone 91 performs downsampling processing through the ISP to obtain the telephoto reduced image output by the ISP; for the ultra-wide-angle image, the mobile phone 91 performs image offset cropping through the ISP according to the updated image offset value.
- the image feature matching is performed on the zoomed-out image. Based on the image feature matching result and the current zoom magnification, the image offset value between the telephoto image center and the ultra-wide-angle image center is calculated, and the offset value is updated based on the image offset value.
- the mobile phone 91 determines that the current zoom magnification is 3.5x, which reaches the camera switching magnification and the target magnification, and requires camera switching and image navigation screen overlay display.
- the mobile phone 91 digitally zooms and crops the telephoto image through the ISP to obtain the telephoto cropped image, and uses the telephoto cropped image as the telephoto preview interface, that is, the telephoto cropped image It is displayed on the photo preview interface 921 as a preview screen.
- the mobile phone 91 also performs downsampling processing on the telephoto cropped image through the ISP to obtain a telephoto reduced image.
- the mobile phone 91 For the ultra-wide-angle image, the mobile phone 91 performs image offset cropping on the ultra-wide-angle image through ISP according to the updated image offset value to obtain the ultra-wide-angle cropped image, and performs downsampling processing on the ultra-wide-angle cropped image to obtain the ultra-wide-angle reduced image.
- the mobile phone 91 performs image feature matching on the ultra-wide-angle reduced image and the telephoto reduced image, and calculates the image offset value between the ultra-wide-angle image center and the telephoto image center based on the image feature matching result and the current zoom magnification, and based on the The image offset value is updated with the offset value.
- the mobile phone 91 also marks the position of the telephoto cropped image in the ultra-wide-angle cropped image according to the image offset value, and performs downsampling processing on the marked ultra-wide-angle cropped image to obtain a marked reduced image.
- the marked reduced image is superimposed on the telephoto preview interface as an ultra-wide-angle navigation screen display.
- the mobile phone 91 displays the telephoto cropped image on the photo preview interface 921, so that the preview image can be switched from the ultra-wide-angle macro camera to the telephoto macro camera, thereby realizing the switching relay of the macro camera. And, mobile phone 91 also overlays and displays the marked reduced image on the preview interface, as shown specifically in the image navigation window 922 in Figure 9 , that is, the image navigation window 922 displays the marked reduced image as the navigation screen, and the rectangular frame 923 Used to identify the position of the preview screen in the navigation screen.
- the mobile phone 91 has switched from ultra-wide-angle macro to telephoto macro, so the ultra-wide-angle macro shortcut control 917 is in a closed state, and the telephoto-macro shortcut control 918 is in an open state.
- the user After switching from ultra-wide-angle macro to telephoto macro, the user continues to drag the zoom control 915 to the right to increase the zoom ratio from 3.5x to 4x.
- the mobile phone 91 determines that the current zoom magnification is 4x, which is in the focal length of the telephoto macro camera.
- the mobile phone 91 executes the process shown in Figure 10 to obtain the telephoto cropped image, and displays the telephoto cropped image on the photo preview interface 924; and according to the image offset value, marks the telephoto cropped image for ultra-wide angle cropping position in the image to identify the position of the telephoto preview image in the ultra-wide-angle navigation image, and display the identified thumbnail image in the image navigation window 922 .
- the user can also continue to drag the zoom control 915 to increase the zoom ratio.
- the zoom magnification is greater than 10x
- the mobile phone 91 can continue to use the picture captured by the ultra-wide-angle macro camera as the image navigation screen, or when the zoom magnification exceeds the telephoto focal length, the navigation screen is not displayed.
- the rectangular frame used for identification on the navigation screen will be smaller, which is not conducive to accurate navigation of high-magnification telephoto images.
- the mobile phone 91 can also use the telephoto full FOV image captured by the telephoto macro camera to navigate the image when the zoom magnification is greater than 10x.
- the focused FOV picture is used as a preview picture.
- the mobile phone 91 when the zoom magnification is in the focal length of the ultra-wide-angle macro camera, which is 0.5x ⁇ 3.5x, the mobile phone 91 does not display the navigation screen superimposed on the preview screen during the zoom process of macro shooting. In other embodiments, the mobile phone 91 can also perform superimposed display of image navigation images in the focal length of the ultra-wide-angle macro camera. However, at the low-to-medium magnification focal length of the ultra-wide-angle macro camera (for example, 0.5x ⁇ 1.5x), the FOV of the preview image is still relatively large, and users can more easily adjust macro composition and find macro shooting targets.
- the navigation screen does not need to be displayed in the low and medium magnification focal lengths of the ultra-wide-angle macro camera.
- the zoom ratio is in the high-magnification focal length of the ultra-wide-angle macro camera (for example, 1.5x ⁇ 3.5x)
- the FOV of the preview image is small, and the convenience of adjusting macro composition and finding macro shooting targets is poor.
- Mobile phone 91 can By superimposing the navigation screen, it improves the user's interactive experience in macro shooting.
- the electronic device 100 is a mobile phone 111, and the mobile phone 111 includes a main camera, a telephoto macro camera, and an ultra-wide-angle macro camera.
- the camera switching magnification is 3.5x and the target magnification is 1.5x.
- the mobile phone 111 displays a photo preview interface 1112 in response to the click operation.
- the photo preview interface 1112 includes a photo subject 1113, a zoom bar 1114 and a zoom control 1115.
- the photo preview interface 1112 displays the image captured by the main camera.
- the current zoom magnification is 1x.
- the mobile phone 111 detects the distance to the photographing subject 1113. When it is detected that the shooting distance of N consecutive frames of images is less than the first threshold, the mobile phone 111 confirms that the conditions for automatically entering the macro shooting mode are met, automatically enters the macro shooting mode, and displays the photo preview interface 1116.
- Photo preview interface 1116 includes super Wide angle macro prompt information 1117.
- the mobile phone 111 enters the macro shooting mode, it turns on the ultra-wide-angle macro camera and the telephoto macro camera to obtain the ultra-wide-angle image captured by the ultra-wide-angle micro camera and the telephoto image captured by the telephoto macro camera.
- the mobile phone 111 uses the ultra-wide-angle macro camera for macro photography by default, and the photo preview interface 1116 displays the picture captured by the ultra-wide-angle macro camera.
- the mobile phone 111 When just entering the macro shooting mode, the mobile phone 111 performs image offset cropping on the image collected by the ultra-wide-angle macro camera according to the initial offset value to obtain the cropped image, and uses the cropped image as the sent display image, that is, the cropped image Displayed in the photo preview interface 1116, that is, after the mobile phone 111 enters the macro shooting mode, the preview screen switches from the screen captured by the main camera to the screen captured by the ultra-wide-angle macro camera.
- the zoom ratio falls into the focal length of the ultra-wide-angle macro camera and belongs to the ultra-wide-angle low-to-medium magnification range.
- the ultra-wide-angle low and medium magnification range is 0.5x ⁇ 1.5x
- the ultra-wide-angle high magnification range is 1.5x ⁇ 3.5x. Therefore, the mobile phone 111 does not display the navigation screen superimposed on the preview screen.
- the user drags the zoom control 1115 to increase the zoom ratio from 1x to 1.5x.
- the mobile phone 111 determines that the current zoom magnification is 1.5x, which reaches the target magnification, does not reach the camera switching magnification, and belongs to the ultra-wide-angle high-magnification range.
- the ultra-wide-angle full FOV picture is used as the navigation picture, and the ultra-wide-angle full FOV picture is used as the navigation picture.
- the wide-angle part FOV is used as a preview screen.
- the mobile phone 111 executes the process shown in Figure 12 to achieve ultra-wide-angle high-magnification navigation.
- the mobile phone 111 downsamples the telephoto image through the ISP to obtain a telephoto reduced image.
- the mobile phone 111 performs image offset cropping on the ultra-wide-angle image through the ISP according to the updated image offset value, obtains the cropped image, and uses the cropped image as the ultra-wide-angle preview screen, that is, the cropped image is displayed in the camera Preview interface 1118;
- the cropped image is also downsampled through ISP to obtain an ultra-wide-angle reduced image, and the ultra-wide-angle reduced image and wide-angle reduced image are matched with image features, and the ultra-wide-angle image center is calculated based on the image feature matching and the current zoom magnification.
- the offset value is updated based on the image offset value.
- the uncropped ultra-wide-angle image is also downsampled to obtain a reduced image, and then based on the updated image offset value, the ultra-wide-angle partial FOV (that is, the cropped image) is marked in the reduced image in the ultra-wide-angle full FOV image.
- a marked thumbnail is obtained, and the marked thumbnail is used as the ultra-wide-angle navigation screen and superimposed on the ultra-wide-angle preview screen.
- the image navigation window 1119 for displaying the image navigation screen and the rectangular frame 1120 are superimposed on the photo preview interface 1118.
- the rectangular frame 1120 is used to identify the position of the ultra-wide-angle preview screen in the ultra-wide-angle navigation screen.
- the user drags the zoom control 1115 to increase the zoom ratio from 1.5x to 3.5x.
- the mobile phone 111 determines that the current zoom magnification is 3.5x, which reaches the camera switching magnification and is a telephoto, low, medium or high magnification. Then it is necessary to switch the camera and use the ultra-wide-angle screen as the navigation screen.
- Use The telephoto screen serves as the preview screen.
- the telephoto low and medium magnification range is 3.5x ⁇ 10x, and the telephoto high magnification range is greater than 10x.
- the mobile phone 111 executes the process shown in Figure 10 to obtain the telephoto preview screen and the ultra-wide-angle navigation screen, and superimposes the ultra-wide-angle navigation screen on the telephoto preview screen.
- the mobile phone 111 displays the photo preview interface 1121.
- the photo preview interface 1121 is superimposed with a navigation window 1119 and a rectangular frame 1120.
- the navigation screen displayed in the navigation window 1119 is as shown in Figure 1119.
- the ultra-wide-angle navigation screen is determined according to the process shown in Figure 10, and the preview screen is the telephoto preview screen determined according to the process shown in Figure 10.
- the user drags the zoom control 1115 to increase the zoom ratio from 3.5x to 12x.
- the mobile phone 111 determines that the current zoom magnification is 12x, which is a high telephoto magnification and needs to be used.
- the mobile phone 111 can execute the process shown in Figure 13 to achieve telephoto and high-magnification navigation.
- the mobile phone 111 performs downsampling processing through the ISP to obtain a reduced image output by the ISP; in addition, it also performs digital zoom cropping on the telephoto full FOV image to crop from the telephoto full FOV image.
- the telephoto part FOV image is generated, and the telephoto part FOV image is used as a telephoto preview screen and displayed on the photo preview interface 1122.
- the mobile phone 111 also marks the position of the cropped partial FOV image in the full FOV image according to the cropping position to obtain the telephoto navigation screen, and displays the telephoto navigation screen on the image navigation window 1119 on the photo preview interface 1122.
- the macro camera of the electronic device 100 may be a fixed focus camera or a continuous zoom camera, which is not limited here.
- the electronic device 100 can perform switching relay based on at least two macro cameras to achieve macro photography with a wider focal length; it can also display a larger image by overlaying it on the preview screen during macro photography.
- FOV navigation screen to improve the convenience of users to adjust macro composition and find macro shooting targets.
- the user can trigger the electronic device 100 to perform a shooting operation to obtain macro shooting pictures or macro shooting videos.
- the electronic device 100 When the electronic device 100 takes a macro picture, the current zoom magnification is different, and the way of taking the picture and outputting the picture may also be different.
- the electronic device 100 includes an ultra-wide-angle macro camera and a telephoto macro camera.
- the electronic device 100 uses the ultra-wide-angle macro camera to take pictures and take pictures; when the zoom magnification is at the ultra-wide-angle high magnification, the electronic device 100 uses the ultra-wide-angle macro camera to obtain ultra-wide-angle images, using The telephoto macro camera acquires a telephoto image, fuses the ultra-wide-angle image and the telephoto image to obtain a fused image, and uses the fused image as an output image; when the zoom magnification is at the telephoto magnification, the electronic device 100 uses the telephoto The macro camera takes pictures and produces pictures.
- the electronic device 100 can determine the position of the telephoto image in the ultra-wide-angle image through image feature matching, that is, determine the area in the ultra-wide-angle image corresponding to the telephoto image, and this area is the telephoto FOV area; Then, the telephoto image is used to improve the image quality of the telephoto FOV image in the ultra-wide-angle image, thereby improving the image quality of macro photography.
- the image fusion method can be arbitrary. For example, directly replace the telephoto FOV area in the ultra-wide-angle image with the telephoto image.
- the fused image 141 is a fused image corresponding to a zoom magnification of 2x, and the fused image includes a telephoto FOV area.
- the electronic device 100 captures a 2x ultra-wide-angle image through the ultra-wide-angle macro camera, and captures a telephoto image through the telephoto macro camera; the telephoto image and the ultra-wide-angle image are matched with image features to determine the ultra-wide-angle image.
- the telephoto FOV area in the wide-angle image is image-fused, and the telephoto image and the ultra-wide-angle image are image fused to obtain a fused image 141, so as to improve the image quality of the telephoto FOV area in the ultra-wide-angle image through the telephoto image.
- the electronic device 100 includes an ultra-wide-angle macro camera and a telephoto macro camera.
- the electronic device 100 After entering the macro shooting mode, the electronic device 100 turns on the telephoto macro camera and the ultra-wide-angle macro camera, and acquires images collected by the two macro cameras.
- the ultra-wide-angle display when the zoom magnification is less than 3.5x, the ultra-wide-angle display is used, that is, the picture captured by the ultra-wide-angle macro camera is used as the preview picture; when the zoom magnification is greater than or equal to At 3.5x, use the telephoto display and wide-angle navigation, that is, use the picture captured by the telephoto camera as the preview picture, and use the picture captured by the ultra-wide-angle macro camera as the navigation picture.
- the electronic device 100 also calculates the image offset value between the ultra-wide-angle image center and the telephoto image center through image feature matching.
- the electronic device 100 uses an ultra-wide angle to take a picture.
- the mobile phone 161 includes a main camera, a telephoto macro camera and an ultra-wide-angle macro camera.
- the mobile phone 161 After the mobile phone 161 detects a click operation on the camera 1611, it displays a photo preview interface 1612 in response to the click operation.
- the photo preview interface 1612 includes a shooting subject 1613, a zoom bar 1614 and a zoom control 1615. At this time, the zoom bar 1614 is at the 1x position. At this time, the photo preview interface displays the image captured by the main camera as the preview image.
- the photo preview interface 1616 In the photo preview state, if the mobile phone 161 determines that the conditions for automatically entering the macro shooting mode are met, the photo preview interface 1616 will be displayed.
- the photo preview interface 1616 includes prompt information 1617.
- the mobile phone 161 uses the ultra-wide-angle macro camera by default for macro photography, that is, switches from the main camera to the ultra-wide-angle macro camera, and displays the picture captured by the ultra-wide-angle macro camera on the photo preview interface 1616 .
- the mobile phone 161 After entering the macro shooting mode, the mobile phone 161 detects a drag operation on the zoom control 1615, and in response to the drag operation, zooms and focuses by pushing the zoom motor and the focus motor, and outputs an image on the preview interface.
- the camera preview interface 1618 When the mobile phone 161 detects that the zoom control 1615 is at 1.5x, the camera preview interface 1618 is displayed.
- the photo preview interface 1618 includes a navigation window 1619 for displaying a navigation screen, and a rectangular frame 1620 for identifying the relative positional relationship between the preview screen and the navigation screen.
- the zoom magnification 1.5x falls within the focal length of the ultra-wide-angle macro camera.
- the mobile phone 161 uses the ultra-wide-angle partial FOV image as the preview screen, and uses the ultra-wide-angle full FOV image as the navigation screen.
- the mobile phone 161 detects a click operation on the camera control 1621, and in response to the click operation, performs a camera operation.
- the zoom magnification of 1.5x is less than 2x
- the ultra-wide-angle image is used to take pictures, that is, the image collected by the ultra-wide-angle macro camera is used as the photo, and the photo is displayed in the control 1622.
- the photo preview screen 1623 is displayed.
- the photo displayed on the photo preview screen 1623 is an image captured by the ultra-wide-angle macro camera when the zoom factor is 1.5x.
- the above-mentioned image alignment scheme can be used to perform image offset cropping, making the picture transition during the zoom process smoother and more natural.
- the electronic device 100 determines the telephoto FOV area in the ultra-wide-angle image according to the updated image offset value, and takes pictures by merging the ultra-wide-angle image and the telephoto image.
- the mobile phone 161 detects a drag operation for the zoom control 1615 in the photo preview state, and responds to the drag operation, And output the image on the preview interface.
- the camera preview interface 1624 When the mobile phone 161 detects that the zoom control 1615 is at 3x, the camera preview interface 1624 is displayed.
- Photo preview The interface 1624 includes a navigation window 1625 for displaying a navigation screen, and a rectangular frame 1626 for identifying the relative positional relationship between the preview screen and the navigation screen.
- the zoom magnification 3x falls within the focal length of the telephoto macro camera.
- the mobile phone 161 uses the ultra-wide-angle partial FOV image as the preview screen, and uses the ultra-wide-angle full FOV image as the navigation screen.
- the mobile phone 161 detects a click operation on the camera control 1627, and in response to the click operation, performs a camera operation.
- the zoom magnification 3x is greater than 2x and less than 3.5x
- the ultra-wide-angle image and the telephoto image are fused to take pictures, that is, the image collected by the ultra-wide-angle macro camera and the image collected by the telephoto macro camera are combined.
- Image fusion is performed to obtain a fused image, and the fused image is displayed in control 1628.
- the photo preview screen 1629 is displayed.
- the photo displayed on the photo preview screen 1629 is a fused image obtained by image fusion when the zoom magnification is 3x.
- the electronic device 100 uses telephoto to take pictures.
- the mobile phone 161 Based on the scene in FIG. 16A, after entering the macro photography mode, the mobile phone 161 detects a drag operation on the zoom control 1615 and responds to the drag operation. Operation, zoom and focus by pushing the zoom motor and focus motor, and output the image on the preview interface. At this time, when the mobile phone 161 detects that the zoom control 1615 is at 4x, it displays the photo preview interface 1630.
- the photo preview interface 1630 includes a navigation window 1631 for displaying a navigation screen, and a rectangular frame 1632 for identifying the relative positional relationship between the preview screen and the navigation screen.
- mobile phone 161 has switched from an ultra-wide-angle macro camera to a telephoto macro camera.
- the zoom magnification 4x falls within the focal length of the telephoto macro camera.
- the mobile phone 161 uses the picture captured by the ultra-wide-angle macro camera as the navigation picture, and uses the picture captured by the telephoto macro camera as the preview picture.
- the mobile phone 161 detects a click operation on the camera control 1633, and in response to the click operation, performs a camera operation.
- the zoom magnification 4x is greater than 3.5x
- the telephoto picture is used to take pictures, that is, the image collected by the telephoto macro camera is used as the photo taken, and the photo is displayed in the control 1634.
- the photo preview screen 1635 is displayed. The photo displayed on the photo preview screen 1635 is an image captured by the telephoto macro camera when the zoom magnification is 4x.
- the mobile phone 161 switches from the ultra-wide-angle macro camera to the telephoto camera when the zoom magnification reaches the camera switching magnification.
- Macro camera In the process of zooming from the ultra-wide-angle focal length to the telephoto focal length, the image offset value between the ultra-wide-angle image center and the telephoto image center is determined through image feature matching, and the image offset is performed based on the image offset value. Crop to align the center of the ultra-wide-angle image and the center of the telephoto image.
- the picture captured by the corresponding macro camera is used as the navigation picture and preview picture according to the zoom magnification.
- the embodiments of the present application provide a macro shooting solution based on at least two macro cameras and a solution for automatically entering and automatically exiting the macro shooting mode.
- image center alignment scheme, and preview navigation scheme can also be applied to other scenes, such as video preview telephoto and video shooting scenes, etc., which are not limited here.
- the mobile phone 171 includes a main camera, a telephoto macro camera, and an ultra-wide-angle macro camera.
- the photo preview interface 1712 is displayed.
- the photo preview interface 1712 includes a shooting subject 1713 and a zoom bar 1714 and zoom control 1715. At this time, zoom control 1714 is in the 1x position. At this time, the photo preview interface displays the picture captured by the main camera.
- the mobile phone 171 When the mobile phone 171 detects a click operation on the video recording control 1716 in the photo preview state, it enters the video recording mode in response to the click operation and displays the video recording preview interface 1717.
- the video preview interface 1717 displays the picture captured by the main camera.
- the mobile phone 171 After the mobile phone 171 enters the video recording mode, in the video preview state, it detects that the shooting distance of N consecutive frames of images is less than the first threshold, then it is determined that the conditions for automatically entering the macro shooting mode are met, the macro shooting mode is entered, and the video preview interface is displayed. 1718.
- the video preview interface 1718 includes prompt information 1719, super wide-angle macro shortcut control 1720 and telephoto macro shortcut control 1721.
- the mobile phone 171 enters the macro shooting mode the ultra-wide-angle macro camera is used by default, and the ultra-wide-angle macro shortcut control 1720 on the video preview interface 1718 is turned on, and the telephoto macro shortcut control 1721 is turned off.
- the video preview interface 1718 displays the picture captured by the ultra-wide-angle macro camera.
- the user increases the zoom ratio from 1x to 1.5x by dragging the zoom control 1715 .
- the mobile phone 171 determines that the current zoom magnification is 1.5x. If the camera switching magnification is not reached, the mobile phone 171 continues to use the ultra-wide-angle macro camera for macro shooting, and displays the picture captured by the ultra-wide-angle macro camera. In the video preview interface 1722.
- the full FOV image captured by the ultra-wide-angle macro camera will be used as the navigation image
- part of the FOV image captured by the ultra-wide-angle macro camera will be used as the preview image, that is, A navigation window 1723 for displaying a navigation screen is displayed on the video preview interface 1722, and a rectangular frame 1724 is used to identify the relative positional relationship between the preview screen and the navigation screen.
- the user increases the zoom ratio from 1.5x to 3.5x by dragging the zoom control 1715 .
- the mobile phone 171 determines that the current zoom magnification is 3.5x.
- the mobile phone 171 switches from the ultra-wide-angle macro camera to the telephoto macro camera, and captures the picture captured by the telephoto macro camera.
- the relative positional relationship between the telephoto image and the ultra-wide-angle image is displayed and marked by a rectangular frame 1727.
- the mobile phone 171 since the mobile phone 171 switches from ultra-wide-angle macro to telephoto macro when the zoom magnification is 3.5x, the ultra-wide-angle macro shortcut control 1720 on the video preview interface 1725 is turned off, and the telephoto macro shortcut control 1721 is turned on. state.
- the image offset value between the ultra-wide-angle image center and the telephoto image center can be calculated through image feature matching, and based on the image The offset value is used to offset and crop the image to obtain the displayed image, thereby making the transition of the macro zoom process more natural and smooth.
- the mobile phone 171 enters the video recording mode and displays the video preview interface 1717, it detects a click operation on the control 1742 and responds to the click operation. , perform recording and display the recording interface 1728. At this time, the video recording interface 1728 displays the picture captured by the main camera.
- the mobile phone 171 In the video recording state, if the mobile phone 171 detects that the shooting distance of N consecutive frames of images is less than the first threshold, it determines that the conditions for automatically entering the macro shooting mode are met, enters the macro shooting mode, and displays the video recording interface 1729.
- the video recording interface 1729 includes prompt information 1730, ultra-wide-angle macro shortcut control 1731, and telephoto macro shortcut control 1731. 1732.
- the mobile phone 171 enters the macro mode it enters the ultra-wide-angle macro by default, and the ultra-wide-angle macro shortcut control 1731 is in the on state, and the telephoto macro shortcut control 1732 is in the off state.
- the video recording screen is switched from the main camera to the ultra-wide-angle macro camera, that is, the video recording interface 1729 displays the video captured by the ultra-wide-angle macro camera.
- the user drags the zoom control 1715 to increase the zoom ratio from 1x to 1.5x.
- the mobile phone 171 determines that the current zoom magnification is 1.5x. If the camera switching magnification is not reached, the mobile phone 171 continues to use the ultra-wide-angle macro camera for recording, and displays the picture captured by the ultra-wide-angle macro camera in the video recording. interface1733.
- the zoom magnification of 1.5x is an ultra-wide-angle high magnification
- the full FOV image captured by the ultra-wide-angle macro camera is used as the navigation image and is superimposed on the recording image, such as the navigation window 1734 used to display the navigation image on the recording interface 1733 as shown, and a rectangular frame 1735 is used to identify the relative positional relationship between the video recording screen and the navigation screen.
- the user drags the zoom control 1715 to increase the zoom ratio from 1.5x to 3.5x.
- the mobile phone 171 determines that the current zoom magnification is 3.5x, switches from the ultra-wide-angle macro camera to the telephoto macro camera, and displays the image captured by the telephoto macro camera on the video recording interface 1736 ;
- the picture captured by the ultra-wide-angle macro camera is also used as a navigation picture and is superimposed on the recording picture, that is, a navigation window 1737 for displaying the navigation picture is displayed, and the relative position between the recording picture and the navigation picture is marked by a rectangular frame 1738 relation.
- the user increases the zoom ratio from 3.5x to 4x by dragging the zoom control 1715 .
- the mobile phone 171 determines that the current zoom magnification is 4x, which belongs to the telephoto focal length, and then continues to display part of the FOV image captured by the telephoto macro camera on the video recording interface 1739; in addition, the telephoto
- the full FOV picture captured by the macro camera is used as a navigation picture and is superimposed on the recording picture, as shown in the navigation window 1740 for displaying the navigation picture on the recording interface 1739, and the relative positions of the recording picture and the navigation picture are identified by a rectangular frame 1741 relation.
- the mobile phone 171 can also calculate the image offset value between the ultra-wide-angle image center and the telephoto image center through image matching, and calculate the image offset value according to This image offset value performs image offset cropping to obtain the displayed image, thereby making the picture transition more natural and smooth when zooming from the ultra-wide-angle focal length to the telephoto focal length.
- the electronic device may include a memory, a processor, and a computer program stored in the memory and executable on the processor.
- the processor executes the computer program
- the method in any one of the above method embodiments is implemented.
- Embodiments of the present application also provide a computer-readable storage medium.
- the computer-readable storage medium stores a computer program.
- the steps in each of the above method embodiments can be implemented.
- Embodiments of the present application provide a computer program product. When the computer program product is run on an electronic device, the steps in each of the above method embodiments can be implemented when the electronic device is executed.
- Embodiments of the present application also provide a chip system.
- the chip system includes a processor.
- the processor is coupled to a memory.
- the processor executes a computer program stored in the memory to implement the methods described in the above method embodiments. method.
- the chip system may be a single chip or a chip module composed of multiple chips.
Landscapes
- Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
本申请实施例公开了一种微距拍摄方法、电子设备和计算机可读存储介质,用于在微距模式的变焦过程中,通过至少两个不同焦段的微距摄像头进行切换接力,以实现更广焦段的微距拍摄。该方法包括:在微距拍摄模式下,当变焦倍率处于第一倍率范围,在取景框显示第一微距摄像头捕获的画面;当变焦倍率为摄像头切换倍率,将取景框显示的画面从第一微距摄像头捕获的画面切换为第二微距摄像头捕获的画面,以在取景框显示第二微距摄像头捕获的画面;当变焦倍率大于摄像头切换倍率,且处于第二倍率范围,在取景框显示第二微距摄像头捕获的画面,第二倍率范围包括摄像头切换倍率;其中,第一微距摄像头的焦段和第二微距摄像头的焦段不同。
Description
本申请要求于2022年04月02日提交国家知识产权局、申请号为202210351277.3、申请名称为“微距拍摄方法、电子设备和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及影像技术领域,尤其涉及一种微距拍摄方法、电子设备和计算机可读存储介质。
微距拍摄可以在超近距离内拍摄微小物体,给用户带来不同的摄影体验。随着微距摄像模组小型化技术的成熟,在小型化和便携式的电子设备上实现微距摄影成为了可能。
目前,通常是使用单个定焦微距摄像头实现微距拍摄功能。例如,手机使用超广角微距摄像头的超近对焦能力和数码变焦来实现超广角微距拍摄功能。
但是,单个定焦微距摄像头的焦段单一,所能覆盖的焦段较少,微距拍摄效果较差。
发明内容
本申请实施例提供一种微距拍摄方法、电子设备和计算机可读存储介质,可以解决现有微距拍摄所能覆盖的焦段单一,微距拍摄效果较差的问题。
第一方面,本申请实施例提供一种微距拍摄方法,应用于电子设备,电子设备包括至少两个微距摄像头,该方法包括:
在微距拍摄模式下,当变焦倍率处于第一倍率范围,在取景框显示第一微距摄像头捕获的画面;
当变焦倍率为摄像头切换倍率,将取景框显示的画面从第一微距摄像头捕获的画面切换为第二微距摄像头捕获的画面;
当变焦倍率大于摄像头切换倍率,且处于第二倍率范围,在取景框显示第二微距摄像头捕获的画面,第二倍率范围包括摄像头切换倍率;
其中,第一微距摄像头的焦段和第二微距摄像头的焦段不同;至少两个微距摄像头包括第一微距摄像头和第二微距摄像头。
由上述技术方案可见,本申请实施例在微距拍摄模式的变焦过程中,基于不同焦段的微距摄像头进行切换接力,以实现更广焦段的微距拍摄,微距拍摄效果更佳。
示例性地,第一微距摄像头为超广角微距摄像头,第二微距摄像头为长焦微距摄像头,第一倍率范围为0.5x~3.5x,第二倍率范围为3.5x~15x,摄像头切换倍率为3.5x。当变焦倍率处于第一倍率范围即超广角焦段时,使用超广角微距摄像头进行微距拍摄;当变焦倍率达到摄像头切换倍率时,则从超广角微距摄像头切换至长焦微距摄像头;当变焦倍率处于第二倍率范围即长焦焦段时,则使用长焦微距摄像头进行微距拍摄。这样,实现了超广角焦段至长焦焦段的微距拍摄。取景框显示的画面可以是微距摄像
头捕获的全FOV画面或部分FOV画面。
在第一方面的一些可能的实现方式中,该方法还包括:
在取景框显示的预览画面上叠加显示导航窗口,导航窗口用于显示导航画面;其中,导航画面的视场角大于预览画面的视场角。
在该实现方式中,在预览画面上叠加显示更大视场角(Field of view,FOV)的导航画面,方便了用户在微距拍摄过程中寻找拍摄主体和构图,提高了用户微距拍摄体验。导航画面和预览画面可以是微距摄像头捕获的全FOV画面或部分FOV画面。
在第一方面的一些可能的实现方式中,当变焦倍率处于第二倍率范围,导航画面为第一微距摄像头捕获的画面,预览画面为第二微距摄像头捕获的画面。示例性地,将长焦微距摄像头捕获的画面作为预览画面,将超广角微距摄像头捕获的画面作为导航画面。
在第一方面的一些可能的实现方式中,当变焦倍率处于第一倍率范围,导航画面和预览画面均为第一微距摄像头捕获的画面;和/或,当变焦倍率处于第二倍率范围,导航画面和预览画面均为第二微距摄像头捕获的画面。
在第一方面的一些可能的实现方式中,当变焦倍率处于第一倍率范围,导航画面和预览画面均为第一微距摄像头捕获的画面;当变焦倍率处于第二倍率范围,导航画面为第一微距摄像头捕获的画面,预览画面为第二微距摄像头捕获的画面。
在第一方面的一些可能的实现方式中,当变焦倍率处于第一倍率范围,导航画面和预览画面均为第一微距摄像头捕获的画面;当变焦倍率处于第三倍率范围,导航画面为第一微距摄像头捕获的画面,预览画面为第二微距摄像头捕获的画面;当变焦倍率处于第四倍率范围,导航画面和预览画面均为第二微距摄像头捕获的画面;其中,第二倍率范围包括第三倍率范围和第四倍率范围,且第三倍率范围包括摄像头切换倍率。
示例性地,第一倍率范围为0.5x~3.5x,此时是超广角预览和超广角导航;第二倍率范围为3.5x~15x,第三倍率范围为3.5x~10x,此时是长焦预览和超广角导航;第二倍率范围为大于10x,此时是长焦预览和长焦导航。
在第一方面的一些可能的实现方式中,变焦倍率处于第一倍率范围;
在取景框显示第一微距摄像头捕获的画面,在取景框显示的预览画面上叠加显示导航窗口,包括:
在第一倍率范围的变焦过程中,根据初始标定的图像偏移值,或上一次更新的图像偏移值,对第一微距摄像头采集的图像进行图像偏移裁剪,获得第一裁剪图像;根据图像偏移值,通过标识图案标识第一裁剪图像在第一微距摄像头采集的图像中的位置,获得第一标识图像;将第一裁剪图像显示在取景框,并在取景框的导航窗口内显示第一标识图像;其中,标识图案用于标识预览画面和导航画面之间的相对位置关系。
进一步地,通过图像匹配的方式得到预览画面和导航画面之间的相对位置关系,并通过标识图案在导航窗口中进行标识,用户可以基于标识图案得知预览画面FOV在导航画面FOV中的位置,方便微距构图和寻找拍摄主体。示例性地,标识图案为矩形框。
另外,还根据图像偏移值对第一微距摄像头采集的图像进行图像偏移裁剪,使得
变焦过程中画面过渡更平滑自然,提高了用户微距拍摄体验。
示例性地,第一倍率范围为0.5x~3.5x,在0.5x~3.5x的变焦过程中,通过图像匹配的方式,确定长焦画面中心和超广角画面中心之间的图像偏移值,并根据图像偏移值对超广角画面进行图像偏移裁剪,并将该裁剪图像作为送显图像,并根据图像偏移值标记预览画面FOV在导航画面FOV中的位置,获得包括矩形框的超广角图像(即第一标识图像),将包括矩形框的超广角图像和裁剪图像叠加显示,以实现超广角预览和超广角导航。具体应用中,可以先将超广角图像缩小后,再根据偏移值在缩小图中标记预览画面的位置,得到包括标记的导航画面,然后再将包括标记的导航画面显示在取景框的相应位置,导航窗口小于取景框,即取景框包括导航窗口。
在第一方面的一些可能的实现方式中,该方法还包括:
根据第一裁剪图像和第二微距摄像头采集的图像进行图像特征匹配,获得第一图像特征匹配结果;根据第一图像特征匹配结果和第一微距摄像头采集的图像的变焦倍率,确定第一微距摄像头采集的图像的图像偏移值,并根据第一微距摄像头采集的图像的图像偏移值进行偏移值更新。在图像特征匹配时,可以先将第一裁剪图像和第二微距摄像头采集的图像进行降采样后,再将两个降采样后的缩小图进行图像特征匹配,以减少计算量。
在第一方面的一些可能的实现方式中,根据第一图像特征匹配结果和第一微距摄像头采集的图像的变焦倍率,确定第一微距摄像头采集的图像的图像偏移值,包括:
通过公式获得第一微距摄像头采集的图像的图像偏移值;其中,offset表示第一微距摄像头的视场中心到第二微距摄像头的视场中心的偏移值,为预先标定的偏移值,或图像特征匹配结果;offsetpre表示上一帧图像的图像偏移值,offsetcur表示当前帧图像的图像偏移值;zoompre表示上一帧图像的变焦倍率,zoomcur表示当前帧图像的变焦倍率;zoomend表示图像偏移结束的变焦倍率,小于或等于摄像头切换倍率;zoomstart表示图像偏移开始的变焦倍率,大于或等于第一微距摄像头的最小变焦倍率。
在第一方面的一些可能的实现方式中,变焦倍率处于第二倍率范围或第三倍率范围;在取景框显示第二微距摄像头捕获的画面,在取景框显示的预览画面上叠加显示导航窗口,包括:
在第二倍率范围或第三倍率范围的变焦过程中,对第二微距摄像头采集的图像进行数字变焦裁剪,获得第二裁剪图像;根据初始标定的图像偏移值或者上一次更新的图像偏移值,通过标识图案标识第二裁剪图像在目标图像中的位置,获得第二标识图像;将第二裁剪图像显示在取景框,并在取景框的导航窗口内显示第二标识图像;其中,目标图像为根据初始标定的图像偏移值或更新的图像偏移值,对第一微距摄像头采集的图像进行图像偏移裁剪获得的第三裁剪图像;或者,第一微距摄像头采集的全视场角图像。在该实现方式中,通过在预览画面上叠加显示导航画面,方便用户进行微距拍摄构图和寻找拍摄主体。
示例性地,使用长焦微距摄像头捕获的长焦画面作为预览画面,使用超广角微距摄像头捕获的画面作为导航画面。第二标识图像可以为包括矩形框的长焦裁剪图像;
具体应用中,可以根据偏移值在从超广角图像裁剪得到的图像中标记预览FOV的位置,得到标记后的图像,再获得标记后的图像的缩小图,以得到导航画面。
在第一方面的一些可能的实现方式中,该方法还包括:根据第二裁剪图像和目标图像进行图像特征匹配,获得第二图像特征匹配结果;根据第二图像特征匹配结果和目标图像的变焦倍率,确定目标图像的图像偏移值,并根据目标图像的图像偏移值进行偏移值更新。
在第一方面的一些可能的实现方式中,变焦倍率处于第四倍率范围;在取景框显示第二微距摄像头捕获的画面,在取景框显示的预览画面上叠加显示导航窗口,包括:对第二微距摄像头采集的图像进行数字变焦裁剪,获得第四裁剪图像;通过标识图案标识第四裁剪图像在第二微距摄像头采集的图像中的位置,获得第三标识图像;将第四裁剪图像显示在取景框,并在取景框的导航窗口内显示第三标识图像。在该实现方式中,通过在预览画面上叠加显示导航画面,方便用户进行微距拍摄构图和寻找拍摄主体。
示例性地,使用长焦微距摄像头的全FOV画面作为导航画面,部分FOV画面作为预览画面。具体应用中,可以先将长焦全FOV画面缩小后,再在缩小后的画面中标记预览FOV的位置。
在第一方面的一些可能的实现方式中,该方法还包括:若变焦倍率处于第五倍率范围,检测到拍照操作,则响应于拍照操作,输出第一微距摄像头采集的图像;若变焦倍率处于第六倍率范围,检测到拍照操作,则响应于拍照操作,将第一微距摄像头采集的图像和第二微距摄像头采集的图像进行图像融合,得到融合图像,并输出融合图像;若变焦倍率处于第二倍率范围,检测到拍照操作,则响应于拍照操作,输出第二微距摄像头采集的图像;其中,第一倍率范围包括第五倍率范围和第六倍率范围。
示例性地,第一倍率范围为0.5x~3.5x,第五倍率范围为0.5x~2x,此时,使用超广角微距摄像头进行拍照出图;第六倍率范围为2x~3.5x,此时,使用超广角图像和长焦图像进行融合;在大于或等于3.5x时,使用长焦微距摄像头进行拍照出图。在该实现方式中,通过图像融合的方式提高了拍照出图质量,进一步提高了用户微距拍摄体验。
在第一方面的一些可能的实现方式中,融合图像包括目标区域和非目标区域,目标区域的图像质量高于非目标区域;目标区域为第一微距摄像头采集的图像中与第二微距摄像头采集的图像对应的区域。示例性地,目标区域为超广角图像中与长焦图像FOV对应的区域。此时,具有更大FOV的超广角画面覆盖长焦FOV画面。
在第一方面的一些可能的实现方式中,该方法还包括:检测目标摄像头采集的图像的第一拍摄距离;若连续N帧图像的第一拍摄距离均小于第一阈值,则从目标摄像头切换至默认微距摄像头,并在取景框显示默认微距摄像头捕获的画面;默认微距摄像头为第一微距摄像头或第二微距摄像头。在该实现方式中,在确定满足自动进入微距拍摄模式的条件时,自动进入微距拍摄模式,进一步提高了微距拍摄体验。示例性地,目标摄像头为主摄像头。
在第一方面的一些可能的实现方式中,该方法还包括:若连续N帧图像的第一拍摄距离均小于第一阈值,在取景框显示提示信息,提示信息用于提示已进入微距拍摄
模式。在该实现方式中,通过提示信息提示用户已进入微距拍摄模式,进一步提高了微距拍摄体验。
在第一方面的一些可能的实现方式中,该方法还包括:检测当前微距摄像头采集的图像的第二拍摄距离;若连续M帧图像的第二拍摄距离均大于第二阈值,则从当前微距摄像头切换至默认摄像头,并在取景框显示默认摄像头捕获的画面;当前微距摄像头为第一微距摄像头或第二微距摄像头。在该实现方式中,在确定满足自动退出微距拍摄模式的条件时,自动退出微距拍摄模式,进一步提高了微距拍摄体验。示例性地,默认摄像头可以是主摄像头,也可以是其它摄像头。
在第一方面的一些可能的实现方式中,取景框还包括第一快捷控件和第二快捷控件;第一快捷控件用于将取景框显示的画面从第一微距摄像头捕获的画面切换至第二微距摄像头捕获的画面;第二快捷控件用于将取景框显示的画面从第二微距摄像头捕获的画面切换至第一微距摄像头捕获的画面。在该实现方式中,通过快捷控件用户可以快捷地切换微距摄像头,进一步提高了用户体验。示例性地,第一快捷控件为长焦微距快捷控件,第二快捷控件为超广角微距快捷控件。
第二方面,本申请实施例提供一种微距拍摄方法,应用于电子设备,该方法包括:
在微距拍摄模式下,在取景框显示第一微距摄像头捕获的画面,并在取景框显示的预览画面上叠加显示导航窗口,导航窗口用于显示导航画面,导航画面的视场角大于预览画面的视场角。
由上述技术方案可知,本申请实施例通过在预览画面上叠加显示更大FOV的导航画面,方便用户进行微距构图和寻找拍摄主体,提高了用户微距拍摄体验。示例性地,第一微距摄像头为长焦微距摄像头或超广角微距摄像头。
在第二方面的一些可能的实现方式中,导航画面为第一微距摄像头捕获的画面;或第二微距摄像头捕获的画面,且第二微距摄像头的视场角大于第一微距摄像头的视场角。
在第二方面的一些可能的实现方式中,导航画面为第一微距摄像头捕获的画面;在取景框显示第一微距摄像头捕获的画面,并在取景框显示的预览画面上叠加显示导航窗口,包括:
根据初始标定的图像偏移值,或上一次更新的图像偏移值,对第一微距摄像头采集的图像进行图像偏移裁剪,获得第一裁剪图像;根据图像偏移值,通过标识图案标识第一裁剪图像在第一微距摄像头采集的图像中的位置,获得第一标识图像;将第一裁剪图像显示在取景框,并在取景框的导航窗口内显示第一标识图像;其中,标识图案用于标识预览画面和导航画面之间的相对位置关系。
示例性地,第一微距摄像头为超广角微距摄像头,使用超广角微距摄像头捕获的全FOV画面作为导航画面,将超广角微距摄像图捕获的部分FOV画面作为预览画面。
在第二方面的一些可能的实现方式中,该方法还包括:
根据第一裁剪图像和第二微距摄像头采集的图像进行图像特征匹配,获得第一图像特征匹配结果;根据第一图像特征匹配结果和第一微距摄像头采集的图像的变焦倍率,确定第一微距摄像头采集的图像的图像偏移值,并根据第一微距摄像头采集的图像的图像偏移值进行偏移值更新。
在第二方面的一些可能的实现方式中,根据第一图像特征匹配结果和第一微距摄像头采集的图像的变焦倍率,确定第一微距摄像头采集的图像的图像偏移值,包括:
通过公式获得第一微距摄像头采集的图像的图像偏移值;其中,offset表示第一微距摄像头的视场中心到第二微距摄像头的视场中心的偏移值,为预先标定的偏移值,或图像特征匹配结果;offsetpre表示上一帧图像的图像偏移值,offsetcur表示当前帧图像的图像偏移值;zoompre表示上一帧图像的变焦倍率,zoomcur表示当前帧图像的变焦倍率;zoomend表示图像偏移结束的变焦倍率,小于或等于摄像头切换倍率;zoomstart表示图像偏移开始的变焦倍率,大于或等于第一微距摄像头的最小变焦倍率。
在第二方面的一些可能的实现方式中,导航画面为第二微距摄像头捕获的画面;
在取景框显示第一微距摄像头捕获的画面,并在取景框显示的预览画面上叠加显示导航窗口,包括:
对第一微距摄像头采集的图像进行数字变焦裁剪,获得第二裁剪图像;根据初始标定的图像偏移值或者上一次更新的图像偏移值,通过标识图案标识第二裁剪图像在目标图像中的位置,获得第二标识图像;将第二裁剪图像显示在取景框,并在取景框的导航窗口内显示第二标识图像;其中,目标图像为根据初始标定的图像偏移值或更新的图像偏移值,对第二微距摄像头采集的图像进行图像偏移裁剪获得的第三裁剪图像;或者,第二微距摄像头采集的全视场角图像。
示例性地,第二微距摄像头为超广角微距摄像头,第一微距摄像头为长焦微距摄像头,使用长焦画面作为预览画面,使用超广角微距摄像头捕获的全FOV画面或部分FOV画面作为导航画面,只要超广角微距摄像头的部分FOV画面的FOV大于长焦画面。
在第二方面的一些可能的实现方式中,该方法还包括:
根据第二裁剪图像和目标图像进行图像特征匹配,获得第二图像特征匹配结果;根据第二图像特征匹配结果和目标图像的变焦倍率,确定目标图像的图像偏移值,并根据目标图像的图像偏移值进行偏移值更新。
在第二方面的一些可能的实现方式中,导航画面为第一微距摄像头捕获的画面;
在取景框显示第一微距摄像头捕获的画面,并在取景框显示的预览画面上叠加显示导航窗口,包括:
对第一微距摄像头采集的图像进行数字变焦裁剪,获得第四裁剪图像;通过标识图案标识第四裁剪图像在第一微距摄像头采集的图像中的位置,获得第三标识图像;将第四裁剪图像显示在取景框,并在取景框的导航窗口内显示第三标识图像。示例性地,第一微距摄像头为长焦微距摄像头,此时,使用长焦微距摄像头捕获的全FOV画面作为导航画面,使用长焦微距摄像头的部分FOV画面作为预览画面。
在第二方面的一些可能的实现方式中,该方法还包括:
检测到拍照操作,则响应于拍照操作,将第一微距摄像头采集的图像和第二微距摄像头采集的图像进行图像融合,得到融合图像,并输出融合图像;融合图像包括目标区域和非目标区域,目标区域的图像质量高于非目标区域;目标区域为第一微距摄
像头采集的图像中与第二微距摄像头采集的图像对应的区域。
在第二方面的一些可能的实现方式中,该方法还包括:
检测目标摄像头采集的图像的第一拍摄距离;若连续N帧图像的第一拍摄距离均小于第一阈值,则从目标摄像头切换至第一微距摄像头,并在取景框显示默认微距摄像头捕获的画面。
在第二方面的一些可能的实现方式中,该方法还包括:若连续N帧图像的第一拍摄距离均小于第一阈值,在取景框显示提示信息,提示信息用于提示已进入微距拍摄模式。
在第二方面的一些可能的实现方式中,该方法还包括:检测第一微距摄像头采集的图像的第二拍摄距离;若连续M帧图像的第二拍摄距离均大于第二阈值,则从第一微距摄像头切换至默认摄像头,并在取景框显示默认摄像头捕获的画面。
第三方面,本申请实施例提供一种电子设备,包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行计算机程序时实现如上述第一方面或第二方面任一项所述的方法。
第四方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现如上述第一方面或第二方面任一项的方法。
第五方面,本申请实施例提供一种芯片***,该芯片***包括处理器,处理器与存储器耦合,处理器执行存储器中存储的计算机程序,以实现如上述第一方面或第二方面任一项所述的方法。该芯片***可以为单个芯片,或者多个芯片组成的芯片模组。
第六方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面或第二方面所述的方法。
可以理解的是,上述第二方面至第六方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
图1为本申请实施例提供的电子设备100的硬件结构示意框图;
图2为本申请实施例提供的电子设备100的软件结构框图;
图3A为本申请实施例提供的手动进入微距拍摄模式的一种示意图;
图3B为本申请实施例提供的自动进入微距拍摄模式的一种示意图;
图3C为本申请实施例提供的提示退出微距拍摄模式的一种示意图;
图3D为本申请实施例提供的微距拍摄模式下变焦过程的一种示意图;
图3E为本申请实施例提供的快捷控件的一种示意图;
图4为本申请实施例提供的超广角预览流程示意图;
图5为本申请实施例提供的单微距摄像头的图像导航流程示意图;
图6为本申请实施例提供的微距拍摄的图像导航示意图;
图7为本申请实施例提供的图像导航的一种示意图;
图8为本申请实施例提供的图像导航的另一种示意图;
图9为本申请实施例提供的长焦低中倍率图像导航方案的一种示意图;
图10为本申请实施例提供的长焦低中倍率图像导航方案的一种流程示意图;
图11为本申请实施例提供的图像导航的又一种示意图;
图12为本申请实施例提供的超广角高倍率导航方案流程示意图;
图13为本申请实施例提供的长焦高倍率导航方案流程示意图;
图14为本申请实施例提供的融合图像示意图;
图15为本申请实施例提供的微距拍摄的一种流程示意图;
图16A为本申请实施例提供的微距拍照的一种示意图;
图16B为本申请实施例提供的微距拍照的另一种示意图;
图16C为本申请实施例提供的微距拍照的又一种示意图;
图17A为本申请实施例提供的微距录像预览场景的一种示意图;
图17B为本申请实施例提供的微距录像的一种示意图。
以下描述中,为了说明而不是为了限定,提出了诸如特定***结构、技术之类的具体细节,以便透彻理解本申请实施例。
目前,电子设备基于单个定焦微距摄像头实现微距拍摄功能的过程中,当变焦倍率不是微距摄像头的缩放倍率时,往往是通过数字变焦技术来获得微距拍摄图像,即通过对微距摄像头在缩放倍率下采集的图像进行裁剪、放大以及插值处理等操作,以获得等效焦距下的微距拍摄图像。但是,单个微距摄像头覆盖的焦段单一,并且裁剪放大后的图像往往会出现图像失真等问题,图像质量较差,微距拍摄效果较差。
以手机为例,手机上集成有超广角微距摄像头,该超广角微距摄像头是缩放倍率为0.5x的定焦摄像头,所能覆盖的变焦倍率范围为0.5x~15x。
手机基于该超广角微距摄像头实现微距拍摄的过程中,当变焦倍率为0.5x时,手机通过该超广角微距摄像头获取光学图像,此时不用进行数字变焦;当变焦倍率大于0.5x时,手机在获取到变焦倍率为0.5x的光学图像后,对该光学图像进行数字变焦,以获得等效焦距下的微距图像。这种情况下,在变焦倍率较高,通过对超广角光学图像进行数字变焦获得的微距图像,图像质量较差。
又例如,手机上集成有长焦微距摄像头,该长焦微距摄像头是缩放倍率为3x的定焦摄像头,所能覆盖的变焦倍率范围为3x~15x。
手机基于该长焦微距摄像头实现微距拍摄的过程中,当变焦倍率为3x时,手机通过该长焦微距摄像头获取光学图像,此时不用进行数字变焦;当变焦倍率大于3x时,手机在获取到变焦倍率为3x的光学图像后,对该光学图像进行数字变焦,以获得等效焦距下的微距图像。同理,在变焦倍率较高,通过对长焦光学图像进行数字变焦获得的微距图像,图像质量较差。另外,基于单个长焦微距摄像头还不能实现3x以下焦段的微距拍摄,导致微距拍摄所覆盖的焦段单一。
针对单个定焦微距摄像头的焦段单一,微距拍摄效果较差的问题,本申请实施例提供基于至少两个微距摄像头的微距拍摄方案,以在微距拍摄的变焦过程中,通过至少两个微距摄像头的切换接力,实现更广焦段的微距拍摄,提高微距拍摄效果。
具体来说,本申请实施例提供的微距拍摄方案中,电子设备具备至少两个微距摄像头,且至少两个微距摄像头的焦段不一致。在微距拍摄模式下,电子设备获取当前变焦倍率后,可以判断当前变焦倍率落在哪个微距摄像头的焦段,以及是否达到摄像
头切换倍率。如果当前变焦倍率落入某个微距摄像头的焦段,电子设备则使用该微距摄像头进行微距拍摄。如果当前变焦倍率达到摄像头切换倍率,电子设备则从当前微距摄像头切换至另一个微距摄像头,并使用另一个微距摄像头进行微距拍摄;如果当前变焦倍率没有达到摄像头切换倍率,则继续使用当前微距摄像头进行微距拍摄。这样,通过多个微距摄像头的切换接力,实现更广焦段的微距拍摄,微距拍摄效果更佳。
其中,微距摄像头是指具有微距对焦和微距摄影能力的摄像头,其可以包括但不限于:超广角微距摄像头、广角微距摄像头、以及长焦微距摄像头。
本申请实施例中,上述至少两个微距摄像头的焦段不一致,进而实现不同焦段和不同变焦倍率下的微距拍摄。
上述至少两个微距摄像头可以是定焦镜头。此时,在微距拍摄模式的变焦过程中,电子设备基于至少两个定焦微距摄像头进行非连续光学变焦。并且,在非连续变焦过程中,通过数字变焦获得相应变焦倍率下的图像。当然,该至少两个微距摄像头可以是连续变焦镜头,在此不作限定。
例如,电子设备包括两个定焦摄像头。一个是缩放倍率为0.5x的超广角微距摄像头,其所能覆盖的变焦倍率为0.5x~3.5x;另一个是缩放倍率为3.5x的长焦微距摄像头,其所能覆盖的变焦倍率为3.5x~15x。摄像头切换倍率为3.5x。
此时,电子设备在微距拍摄的变焦过程中,获取当前变焦倍率,如果当前变焦倍率处于0.5x~3.5x时,则使用超广角微距摄像头进行微距拍摄;如果当前变焦倍率为3.5x时,则确定变焦倍率达到摄像头切换倍率,并执行摄像头切换,以从超广角微距摄像头切换至长焦微距摄像头,切换之后,使用长焦微距摄像头进行微距拍摄;如果当前变焦倍率大于3.5x时,则使用长焦微距摄像头进行微距拍摄。
可以理解的是,如果当前变焦倍率处于0.5x~3.5x时,电子设备对超广角微距摄像头采集的图像进行数字变焦裁剪,以获得相应变焦倍率下的图像;如果当前变焦倍率大于3.5x时,电子设备对长焦微距摄像头采集的图像进行数字变焦裁剪,以获得相应变焦倍率下的图像。
相较于现有基于单个定焦微距摄像头的微距拍摄方案,本申请实施例提供的基于至少两个定焦微距摄像头的微距拍摄方案,微距拍摄所覆盖的焦段更广,微距拍摄效果更好。
具体来说,上文提及的基于定焦的长焦微距摄像头的微距拍摄方案,其只能实现3x~15x的微距拍摄,不能实现3x以下焦段的微距拍摄。而本申请实施例基于0.5x的超广角微距摄像头和3.5x的长焦微距摄像头,可以实现0.5x~15x的微距拍摄,微距拍摄所覆盖的焦段更广。
另外,上文提及的基于定焦的超广角微距摄像头的微距拍摄方案,虽然能实现0.5x~15x的微距拍摄,但在变焦倍率较高(例如10x)时,还对0.5x的广角光学图像进行数字变焦裁剪,以获得微距图像,图像质量较差,微距拍摄效果较差。而本申请实施例基于两个定焦摄像头的微距拍摄方案中,在变焦倍率大于3.5x时,不再对0.5x的广角光学图像进行数字变焦裁剪,而是对3.5x的长焦光学图像进行数字变焦裁剪。
在变焦倍率大于3.5x时,相较于通过对0.5x的广角光学图像进行数字变焦裁剪获得的图像,通过对3.5x的长焦光学图像进行数字变焦裁剪获得的图像的质量更好,进
而提高了微距拍摄效果。
可以理解的是,焦段是指镜头焦距的分段。变焦倍率和焦距可以相互转换,为了表述方便,上文通过变焦倍率表示焦段。例如,超广角微距摄像头的焦段为0.5x~3.5x,是指变焦倍率0.5x~3.5x对应的焦距范围,其中,变焦倍率0.5x对应的焦距为超广角微距摄像头的焦距,其它变焦倍率对应的焦距为通过数字变焦得到的等效焦距。
本申请实施例的电子设备可以为但不限于手机、平板电脑、以及笔记本电脑等,本申请实施例对电子设备的具体类型和具体结构作限定。
示例性地,请参见图1,为本申请实施例提供的电子设备100的硬件结构示意图。如图1所示,电子设备100可以包括处理器101,存储器102,对焦马达103以及微距摄像头104。电子设备100可以包括1个或N个微距摄像头104,N为大于1的正整数。当然,电子设备100除了包括微距摄像头,还可以包括其他类型的摄像头。例如,电子设备100为手机,且包括一个超广角微距摄像头、一个长焦微距摄像头、以及一个主摄像头。
可选地,电子设备100还可以包括传感器模块105。其中,传感器模块105可以包括但不限于距离传感器105A等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件,或软件和硬件的组合实现。例如,当电子设备100为手机或平板电脑时,电子设备100还可以包括由显示屏和触摸传感器组成的触摸屏等。
处理器101可以包括一个或多个处理单元。例如,处理器101可以包括应用处理器(application processor,AP),图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,和/或数字信号处理器(digital signal processor,DSP)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
在一些实施例中,处理器101可以包括一个或多个接口。接口可以包括移动产业处理器接口(mobile industry processor interface,MIPI)和/或通用输入输出(general-purpose input/output,GPIO)接口等。
MIPI接口可以被用于连接处理器101与显示屏,摄像头104等***器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器101和微距摄像头104通过CSI接口通信,实现电子设备100的微距拍摄功能。处理器101和显示屏通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器101与微距摄像头104,显示屏,传感器模块105等。GPIO接口还可以被配置为MIPI接口等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,
并不构成对电子设备100的结构限定。在本申请的另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
电子设备100可以通过ISP,微距摄像头104,视频编解码器,GPU,显示屏以及应用处理器等实现拍摄功能。
ISP用于处理微距摄像头104反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在微距摄像头104中。
微距摄像头104用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。
本申请实施例中的光学变焦也可以是基于多个定焦镜头实现的,此时,微距摄像头104中的一个或多个摄像头模组可以包括多个定焦镜头。数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。
存储器102可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器101通过运行存储在内部存储器的指令,从而执行电子设备100的各种功能应用以及数据处理。存储器102可以包括存储程序区和存储数据区。其中,存储程序区可存储操作***,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
距离传感器105A用于测量镜头与被摄主体之间的距离。电子设备100可以通过红外测距传感器、激光测距传感器或飞行时间相机(Time of flight,TOF)测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器105A测距以实现快速对焦。本申请实施例中,在微距拍摄场景下,电子设备也可以利用距离传感器105A测距,以实现自动进入微距拍摄模式和自动退出微距拍摄模式的功能。对焦马达103用于控制对焦模组在对焦范围内移动以实现对焦。通常情况下,电子设备100先变焦再对焦。例如,在微距拍摄场景下,电子设备100进入微距拍摄模式后,根据用户选择的变焦倍率进行变焦,在变焦后再对焦。
在介绍完电子设备100的硬件架构之后,下面示例性地对电子设备100的软件架构进行介绍。
电子设备100的软件***可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android***为例,示例性说明电子设备100的软件结构。
图2为本申请实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android***分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和***库,以及内核层。
应用程序层可以包括一系列应用程序包。如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图***,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。这些数据可以包括视频,图像,音频等。
视图***包括可视控件,例如显示文字的控件,显示图片的控件等。视图***可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在***顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime(安卓进行时)包括核心库和虚拟机。Android runtime负责安卓***的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
***库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子***进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如,MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动,以及对焦马达驱动。
下面结合拍摄场景,示例性说明电子设备100软件以及硬件的工作流程。
例如,当触摸传感器接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过微距摄像头104捕获静态图像或视频。
在介绍完电子设备100可能涉及的硬件架构和软件架构之后,下面以电子设备100为例对本申请实施例提供的技术方案进行详细阐述。
本申请实施例提供的基于至少两个微距摄像头的微距拍摄方案中,电子设备100可以先进入微距拍摄模式,然后在微距拍摄模式的变焦过程中,获取当前变焦倍率,并根据当前变焦倍率确定所使用的微距摄像头,以及是否进行微距摄像头切换。
在本申请的一些实施例中,电子设备100可以响应于用户指令进入微距拍摄模式,该用户指令用于指示电子设备100进入微距拍摄模式。即用户可以手动进入微距拍摄模式。
例如,参见图3A示出的手动进入微距拍摄模式的一种示意图,电子设备100具体为手机31,并且手机31包括主摄像头、超广角微距摄像头以及长焦微距摄像头。如图3A所示,手机31的主界面311包括智慧生活、设置、日历、图库以及相机312等应用程序。当手机31检测到用户针对相机312的点击操作时,手机31则响应于该点击操作,显示预览界面313。此时,预览界面313显示的主摄像头捕获的画面,该画面包括拍摄主体319。预览界面313包括变焦条314和变焦控件315,还包括各种拍摄模式的控件,分别为:光圈模式控件、夜景模式控件、录像模式控件316、拍照模式控件317、以及微距模式控件318。手机31当前处于拍照模式。
变焦条314上显示当前变焦倍率为1x。用户可以在变焦条314拖动变焦控件315以改变变焦倍率。向左拖动变焦控件315可以增大变焦倍率,向右拖动变焦控件315可以减小变焦倍率。
用户可以通过点击拍摄模式的控件以进入相应的拍摄模式。例如,如果用户需要进入录像模式,则可以点击录像模式控件316,以进入录像模式。
为了进入微距拍摄模式,用户可以手动点击微距模式控件318。手机31检测到针对微距模式控件318的点击操作后,响应于该点击操作,进入微距拍摄模式,并显示预览界面320。此时,上述用于指示电子设备100进入微距拍摄模式的用户指令为针对微距模式控件318的点击指令。
具体来说,手机31在检测到针对微距模式控件318的点击操作后,则从当前的拍照模式切换至微距拍摄模式,并启动超广角微距摄像头,获取通过超广角微距摄像头采集的图像数据,在预览界面320上显示超广角微距摄像头捕获的画面。即在检测到针对微距模式控件318的点击操作后,手机31从主摄像头切换至超广角微距摄像头。此时,在微距拍摄模式开启的时候,默认从主摄像头切换至超广角微距摄像头。在另一些实施例中,也可以默认从主摄像头切换长焦微距摄像头,即在进入微距拍摄模式后,在预览界面320显示长焦微距摄像头捕获的画面。
从主摄像头切换至超广角微距摄像头时,保持预览界面320上显示画面的FOV不变。当然,在摄像头切换也可以不用保持预览界面320上显示画面的FOV不变,在此不作限定。
在本申请的一些实施例中,电子设备100也可以响应于用于指示退出微距拍摄模式的用户指令,退出微距拍摄模式。即用户可以手动退出微距拍摄模式。
以图3A为例,如果用户需要退出微距拍摄模式,可以点击其它拍摄模式的控件,以手动退出微距拍摄模式。例如,手机31在进入微距拍摄模式后,检测到用户点击录像模式控件316的点击操作,则响应于针对录像模式控件316的点击操作,退出微距拍摄模式并进入录像模式。当然,用户可以通过手动退出相机程序,以手动退出微距拍摄模式。或者,手机31也可以提供一个用于退出微距拍摄模式的控件,当检测到用户针对该控件的点击操作时,则响应于该点击操作,退出微距拍摄模式。在此不对手动退出微距拍摄模式的方式进行限定。
电子设备100除了可以手动进入微距拍摄模式和手动退出微距拍摄模式之外,在本申请的另一些实施例中,电子设备100也可以自动进入微距拍摄模式和自动退出微距拍摄模式。此时,电子设备100在确定符合自动进入微距拍摄模式的条件时,则自动进入微距拍摄模式;在确定符合自动退出微距拍摄模式的条件时,则自动退出微距拍摄模式。
示例性地,自动进入微距拍摄模式的条件为:检测到连续N帧图像的拍摄距离小于第一阈值。自动退出微距拍摄模式的条件为:检测到连续M帧图像的拍摄距离大于第二阈值。例如,N为30帧,第一阈值为10cm;M为60帧,第二阈值为50cm。
具体应用中,电子设备100可以通过距离传感器105A或TOF进行测距,以检测出上述拍摄距离。
值得指出的是,自动进入微距拍摄模式的条件和自动退出微距拍摄模式的条件还可以为其它,在此不作限定。
例如,为了减少计算量,电子设备100可以每隔预设数量帧(例如2帧)再检测图像的拍摄距离,并且在N帧图像内检测到的拍摄距离均小于第一阈值时,则确定满足自动进入微距拍摄模式的条件,自动进入微距拍摄模式。同理,电子设备100也可以每隔预设数量帧(例如3帧)再检测图像的拍摄距离,并且在M帧图像内检测到的拍摄距离均大于第二阈值时,则确定满足自动退出微距拍摄模式的条件,自动退出微距拍摄模式。
又例如,自动进入微距拍摄模式的条件为:在第一时间段内检测到的拍摄距离均小于第三阈值。自动退出微距拍摄模式的条件为:在第二时间段内检测到的拍摄距离均大于第四阈值。第一时间段、第二时间段、第三阈值以及第四阈值均可以根据实际需要设定。
示例性地,参见图3B示出的自动进入微距拍摄模式的一种示意图,手机31检测到用户针对相机312的点击操作时,则响应于该点击操作,显示预览界面321。预览界面321显示的主摄像头捕获的画面,该画面包括拍摄主体319。手机31当前处于拍照模式,即预览界面321为拍照预览界面。
手机31在进入拍照预览状态后,检测与拍摄主体319之间的距离即拍摄距离,并
判断该拍摄距离是否小于第一阈值。如果检测到主摄像头采集的连续N帧图像的拍摄距离均小于第一阈值,手机31则确定满足自动进入微距拍摄模式的条件,并自动进入微距拍摄模式。手机31进入微距拍摄模式后,从主摄像头切换至超广角微距摄像头,并在预览界面322上显示超广角微距摄像头捕获的画面。另外,为了提示用户已经进入微距拍摄模式,手机31还在预览界面322上显示提示信息323,该提示信息323具体为“微距模式已开启”,用于提示用户当前已自动进入微距拍摄模式。
可以理解的是,除了可以通过提示信息323提示用户当前已自动进入微距拍摄模式之外,还可以通过其它方式提示用户已进入微距拍摄模式。例如,手机31通过扬声器播放提示语音“微距模式已开启”。此外,除了通过提示操作提示用户当前已自动进入微距拍摄模式之外,还可以通过提示操作提示用户在微距拍摄模式下应该如何操作。例如,手机31还可以在预览界面322上显示微距拍摄模式操作提示信息。当然,手机31也可以不执行提示操作。
另外,为了减少误操作,电子设备100在确定满足自动微距拍摄模式的条件之后,也可以先执行提示操作,以提示用户是否进入微距拍摄模式;在接收到用户确认进入微距拍摄模式的指令后,再进入微距拍摄模式。例如,基于图3B的场景,手机31在确定满足自动进入微距拍摄模式的条件后,在预览界面321上弹出提示窗口,该提示窗口包括“是”和“否”两个选项按钮,以及提示信息“当前已检测到满足条件,是否进入微距拍摄模式”;当手机31检测到针对“是”选项按钮的点击操作时,则响应于该点击操作,进入微距拍摄模式。
需要说明的是,图3A与图3B的相同部分请参见上文,在此不再赘述。
还需要说明的是,图3B中并没有将微距拍摄模式设置为与拍照、录像等模式并行的拍摄模式,而是将微距拍摄模式设置在拍照模式下。而图3A中单独设置一种微距拍摄模式,该微距拍摄模式与拍照模式、录像模式等模式并行。在具体实现中,图3A和图3B的两种方式均可,即可以将微距拍摄功能单独设置为一种拍摄模式,也可以将微距拍摄功能设置在其它拍摄模式下,在此不作限定。
在图3B的场景中,手机31在自动进入微距拍摄模式后,通过距离传感器或TOF等,继续检测与拍摄主体319之间的拍摄距离,并判断拍摄距离是否大于第二阈值。如果检测到微距摄像头采集的连续M帧图像的拍摄距离均大于第二阈值,手机31则确定满足自动退出微距拍摄模式的条件,并自动退出微距拍摄模式。
为了提高用户体验,电子设备100可以在自动退出微距拍摄模式时,在预览界面显示相应的提示信息,以提示用户当前已退出微距拍摄模式。例如,参见图3C示出的提示退出微距拍摄模式的一种示意图,基于图3B的场景,手机31处于微距拍摄模式下,在确定出满足自动退出微距拍摄模式的条件后,则自动退出微距拍摄模式,并在预览界面324上显示提示信息325,以提示用户当前已关闭微距拍摄模式。提示信息325具体为“微距模式已关闭”。其中,图3C与图3A、图3B的相同部分可以参见上文,在此不再赘述。
在本申请实施例中,电子设备100在退出微距拍摄模式时,可以根据当前变焦倍率,确定退出微距拍摄模式后所使用的摄像头焦段。例如,电子设备100包括主摄像头、长焦微距摄像头以及超广角微距摄像头。电子设备100在退出微距拍摄模式时,
如果当前变焦倍率处于长焦焦段,则退回正常长焦预览并对焦,即在预览界面上显示对焦后的长焦图像;如果当前变焦倍率处于广角1x以上焦段,则退回主摄预览,即在预览界面上显示主摄像头捕获的画面;如果当前变焦倍率处于广角1x以下焦段,则退回广角焦段,即在预览界面上显示超广角摄像头捕获的画面。可以理解的是,长焦微距摄像头是指具有微距摄影能力的长焦摄像头,超广角微距摄像头是指具有微距摄影能力的超广角摄像头。
当然,电子设备100在退出微距拍摄模式时,也可以退回默认焦段和默认摄像头。例如,预先设置在退出微距拍摄模式时,默认焦段为主摄像头的焦段,默认摄像头为主摄像头,即无论在退出微距拍摄模式时的当前变焦倍率是处于哪个焦段,在退出微距拍摄模式时,均自动切换至主摄像头和主摄像头的焦段。
由上可见,电子设备100可以手动进入和退出微距拍摄模式,也可以自动进入和退出微距拍摄模式。相较而言,电子设备100根据拍摄距离确定是否自动进入和退出微距拍摄模式,操作更便捷,用户微距摄影体验更佳。进一步地,在进入和/或退出微距拍摄模式时,通过提示信息提示用户已进入和已退出微距拍摄模式,用户的微距摄影体验也更高。
可以理解的是,在本申请实施例的又一些实施例中,电子设备100可以默认处于微距拍摄模式下,即电子设备100可以不用从另一个拍摄模式进入微距拍摄模式。
在本申请实施例中,电子设备100在进入微距拍摄模式后,获取当前变焦倍率,根据微距摄像头的焦段,确定当前变焦倍率是否达到摄像头切换倍率;如果当前变焦类倍率达到摄像头切换倍率,则进行微距摄像头切换,以实现更广焦段的微距摄影。
在微距拍摄模式的变焦过程中,变焦倍率可以是通过人机交互得到的,即该变焦倍率是用户输入的;也可以是电子设备100自主确定的。
例如,参见图3D示出的微距拍摄模式下变焦过程的一种示意图,基于图3B的场景,手机31在确定满足自动进入微距拍摄模式的条件后,自动进入微距拍摄模式,在预览界面322上显示超广角微距摄像头捕获的画面,并且,还在预览界面322上显示提示信息323,以提示用户微距模式已开启。
在进入微距拍摄模式后,用户可以通过在变焦条314上拖动变焦控件315,以改变变焦倍率。在变焦过程中,如果当前变焦倍率达到摄像头倍率切换倍率,手机31的拍照预览画面则从超广角微距摄像头切换至长焦微距摄像头,或者从长焦微距摄像头切换至超广角微距摄像头。
其中,为了描述方便,除特别提及之外,下文提及的超广角微距摄像头和长焦微距摄像头均为定焦摄像头,且超广角微距摄像头覆盖的变焦倍率范围为0.5x~3.5x,该范围包括0.5x,不包括3.5x;长焦微距摄像头覆盖的变焦倍率范围为3.5x~15x,该范围包括3.5x。摄像头切换倍率为3.5x。当然,具体应用中,超广角微距摄像头和长焦微距摄像头支持的变焦倍率范围不限于上文提及的范围。
如图3D所示,预览界面322上显示的当前变焦倍率为1x。用户向右拖动变焦控件315,以增大变焦倍率至1.5x。手机31响应于用户针对变焦控件315的拖动操作,获取到当前变焦倍率为1.5x,并确定当前变焦倍率1.5x未达到摄像头切换倍率3.5x。并且,当前变焦倍率1.5x落入超广角微距摄像头的焦段,故在变焦倍率从1x增大至
1.5x的过程中,手机31不用进行微距摄像头的切换,还是使用超广角微距摄像头进行微距拍摄。具体地,手机31对超广角微距摄像头采集的图像进行数字变焦裁剪,以获得送显图像,并在预览界面326上显示该送显图像,以在预览画面326上显示超广角微距摄像头捕获的画面。
用户将变焦倍率增大至1.5x后,继续向右拖动变焦控件315,以将变焦倍率从1.5x增大至3.5x。手机31响应于用户针对变焦控件315的拖动操作,获取到当前变焦倍率为3.5x。手机31确定出当前变焦倍率3.5x达到摄像头切换倍率,需要进行微距摄像头的切换接力,则从超广角微距摄像头切换至长焦微距摄像头,使用长焦微距摄像头进行微距拍摄。具体地,手机31根据当前变焦倍率,在预览界面327上显示长焦微距摄像头捕获的画面。这样,在变焦倍率达到摄像头切换倍率时,手机31的预览界面显示的画面由超广角微距摄像头切换为长焦微距摄像头。
用户将变焦倍率增大至3.5x后,继续向右拖动变焦控件315,以将变焦倍率从3.5x增大至4.0x。手机31响应于用户针对变焦控件315的拖动操作,获取到当前变焦倍率为4.0x。手机31确定出当前变焦倍率4.0x未达到摄像头切换倍率,不需要进行微距摄像头的切换接力,则继续使用长焦微距摄像头进行微距拍摄。具体地,手机31根据当前变焦倍率,对长焦微距摄像头采集的图像进行数字变焦裁剪,获得送显图像,并将该送显图像显示在预览界面328,以在预览界面328上显示长焦微距摄像头捕获的画面。预览界面328和预览界面327上还显示了当前变焦倍率。
对比预览界面326、预览界面327、预览界面328和预览界面327可知,拍照主体319的倍率越来越大。
在图3D的场景中,在微距拍摄模式下,手机31通过超广角微距摄像头和长焦微距摄像头的切换接力,实现了从超广角焦段到长焦焦段的手机微距摄影。
在本申请实施例中,除了可以通过拖动变焦控件315进行摄像头切换之外,还可以通过快捷控件进行摄像头切换。
示例性地,参见图3E示出的快捷控件的一种示意图,基于图3B的场景,手机31在自动进入微距拍摄模式后,在预览界面329显示提示信息323,并默认从主摄像头切换至超广角微距摄像头,使用超广角微距摄像头进行微距拍摄,即在预览界面329显示超广角微距摄像头捕获的画面。
预览界面329还包括超广角微距快捷控件330和长焦微距快捷控件331。用户如果需要进入超广角微距模式,可以点击超广角微距快捷控件330;如果需要进入长焦微距模式,可以点击长焦微距快捷控件331。其中,在超广角微距模式下,使用超广角微距摄像头进行微距拍摄;在长焦微距模式下,使用长焦微距摄像头进行微距拍摄。
如图3E所示,手机31在确定满足自动进入微距拍摄模式的条件后,自动进入微距拍摄模式,并在自动进入微距拍摄模式时,默认进入超广角微距模式。此时,预览界面329中的超广角微距快捷控件330处于开启状态,长焦微距快捷控件331处于关闭状态。
需要说明的是,为了便于区分快捷控件的开启状态和关闭状态,图3E中通过在快捷控件上附加阴影以表示快捷控件的关闭状态,在快捷控件上不附加阴影以表示快捷控件的开启状态。具体应用中,开启状态和关闭状态也可以通过其它方式区分,例如,
可以通过不同颜色分别表示开启状态和关闭状态。
另外,快捷控件的具体表现形式不限于图3D所示,在此不作限定。还有,快捷控件的显示位置也不限于图3D所示,例如,可以将长焦微距快捷控件显示变焦条314上,且处于变焦倍率为3.5x的位置,在此也不作限定。
手机31默认进入超广角微距模式后,用户可以通过点击长焦微距快捷控件331,以从超广角微距模式切换至长焦微距模式。如图3E所示,手机31在检测到针对长焦微距快捷控件331的点击操作后,响应于该点击操作,将变焦倍率从1x增大至3.5x,从超广角微距摄像头切换至长焦微距摄像头,使用长焦微距摄像头进行微距拍摄,即在预览界面332显示长焦微距摄像头捕获的画面。预览界面332上的超广角微距快捷控件330处于关闭状态,长焦微距快捷控件331处于开启状态。
手机31在切换至长焦微距模式后,如果用户需要切换至超广角微距模式,也可以通过点击超广角微距快捷控件330,以从长焦微距模式快捷切换至超广角微距模式。
在图3E的场景中,手机31除了可以根据拍摄距离自动退出微距拍摄模式之外,还可以通过超广角微距快捷控件330退出微距拍摄模式。例如,手机31处于超广角微距模式下,即超广角微距快捷控件330处于开启状态,长焦微距快捷控件331处于关闭状态,用户可以通过点击超广角微距快捷控件330,以退出微距拍摄模式。
可以理解的是,在图3E的场景中,手机31进入微距拍摄模式后,用户也可以通过拖动变焦控件315以改变变焦倍率。当用户通过拖动变焦控件315增大变焦倍率至3.5x时,手机31确定当前变焦倍率3.5x达到摄像头切换倍率,则从超广角微距摄像头切换至长焦微距摄像头,使用长焦微距摄像头进行微距拍摄,并将长焦微距快捷控件331显示为开启状态,将超广角微距快捷控件330显示关闭状态。
值得指出的是,相较于通过在变焦条上拖动变焦控件以实现微距摄像头切换的方式,通过快捷控件实现微距摄像头切换的方式的操作便捷性更高,用户微距摄影体验更佳。
需要说明的是,当电子设备100包括至少三个微距摄像头时,微距拍摄模式下的变焦过程与上文示例的两个微距摄像头的变焦过程类似,即在变焦倍率达到摄像头切换倍率时,则进行微距摄像头切换接力;当变焦倍率没有达到摄像头切换倍率时,则使用当变焦倍率对应焦段的微距摄像头进行微距拍摄。
由上可见,本申请实施例提供的基于至少两个微距摄像头的微距拍摄方案,在微距拍摄模式的变焦过程中,通过至少两个微距摄像头的切换接力,实现更广焦段的微距摄影,微距摄影效果更佳。
基于上述实施例可知,基于至少两个微距摄像头的微距拍摄方案中,电子设备100需要进行微距摄像头的切换接力。但是,各个微距摄像头的视场中心不一致,导致各个微距摄像头的图像中心之间存在偏移,进而导致变焦过程中微距摄像头切换时,画面过渡不平滑、不自然,降低了用户微距摄影体验。
为了提高微距摄像头切换时的画面过渡效果,使得微距摄像头切换时画面过渡更平滑自然,以提高用户微距拍摄体验,本申请实施例提供了图像中心对齐方案,该图像中心对齐方案在微距拍摄模式的变焦过程中,根据图像偏移值,对第一目标微距摄像头采集的图像进行图像偏移裁剪,获得裁剪图像,并将该裁剪图像作为送显图像;
并且,根据裁剪图像,计算第一目标微距摄像头的图像中心和第二目标微距摄像头的图像中心之间的图像偏移值,根据图像偏移值,进行偏移值更新。这样,通过图像偏移值进行图像偏移裁剪,使得裁剪图像的中心和第二目标微距摄像头采集的图像的中心在变焦过程中逐渐接近,从第一目标微距摄像头切换至第二目标微距摄像头时,显示图像的视场中心保持不变,画面过渡更加平滑自然。
其中,为了描述方便,微距摄像头切换过程涉及的两个微距摄像头定义为第一目标微距摄像头和第二目标微距摄像头。第一目标微距摄像头是指当前变焦倍率对应焦段的微距摄像头,即当前正在使用的微距摄像头。第二目标微距摄像头是指需要切换的微距摄像头,即需要从第一目标微距摄像头切换至第二目标微距摄像头。通常情况下,第二目标微距摄像头的焦段和第一目标微距摄像头的焦段相邻。第一目标微距摄像头的焦段小于第二目标微距摄像头的焦段。
电子设备100在进入微距拍摄模式后,开启第一目标微距摄像头和第二目标微距摄像头,并获取通过第一目标微距摄像头和第二目标微距摄像头采集的图像。
在初始阶段时,图像偏移值为初始图像偏移值,初始图像偏移值是预先标定的。电子设备100根据初始图像偏移值,对第一目标微距摄像头采集的图像进行图像偏移裁剪,获得裁剪图像;再将该裁剪图像作为送显图像,即在预览界面显示裁剪图像,并基于裁剪图像和第二目标微距摄像头采集的图像进行图像特征匹配,获得图像特征匹配结果;然后根据图像特征匹配结果,确定当前帧图像的图像偏移值,并根据当前帧图像的图像偏移值,更新图像偏移值。其中,该当前帧图像为第一目标微距摄像头采集的图像。偏移值更新是指将计算得到的图像偏移值作为新的图像偏移值。
图像偏移值更新后,图像偏移值为上一次更新的图像偏移值。当变焦倍率变化时,电子设备100根据更新的图像偏移值,对第一目标微距摄像头采集的图像进行图像偏移裁剪,获得裁剪图像;将裁剪图像作为送显图像,即在预览界面显示裁剪图像,并基于裁剪图像和第二目标微距摄像头采集的图像进行图像特征匹配,再根据图像特征匹配结果,确定当前帧图像的图像偏移值;然后根据当前帧图像的图像偏移值,进行图像偏移值更新。依此循环,直到变焦倍率达到摄像头切换倍率,则将送显图像从裁剪图像替换为第二目标微距摄像头采集的图像。
例如,在微距拍摄的变焦过程中,对于第一目标微距摄像头的第N帧图像,根据上一次更新的图像偏移值,对第N帧图像进行图像偏移裁剪,获得第N帧图像对应的送显图像;并且,根据第N帧图像对应的送显图像和第二目标微距摄像头采集的图像,进行图像特征匹配,以计算出第N帧图像对应的图像偏移值,并将图像偏移值更新为第N帧图像对应的图像偏移值。
假如图像偏移裁剪是每帧图像均进行,对于第N帧图像,上一次更新的图像偏移值为第N-1帧图像对应的图像偏移值。在第N+1帧时,根据第N帧图像对应的图像偏移值,对第N+1帧图像进行图像偏移裁剪,以获得第N+1帧图像对应的送显图像;并且,根据第N+1帧图像对应的送显图像和第二目标微距摄像头采集的图像,进行图像特征匹配,以计算出第N+1帧图像对应的图像偏移值,并将图像偏移值更新为第N+1帧图像对应的图像偏移值。当然,图像偏移裁剪也不用每帧图像均进行。
其中,图像特征匹配方式可以为但不限于尺度不变特征变换(Scale-invariant
feature transform,SIFT)、快速最近邻搜索包(Fast Library for Approximate Nearest Neighbors,FLANN)、或ORB(Oriented Fast and Rotated Brief)等方法,在此不对图像特征匹配方式作限定。
在图像特征匹配过程中,为了降低计算量,可以将裁剪图像和第二微距摄像头采集的图像进行降采样,再使用降采样后的缩小图进行图像特征匹配。
示例性地,通过以下公式1计算当前帧图像的图像偏移值。
其中,offset表示第一目标微距摄像头的视场中心到第二目标微距摄像头的视场中心的偏移值,其初始值由预先标定的数据得到,之后会实时更新为图像特征匹配算法计算得到的值。offsetpre表示上一帧图像的图像偏移值,offsetcur表示当前帧图像的图像偏移值。zoompre表示上一帧图像的变焦倍率,zoomcur表示当前帧图像的变焦倍率。zoomend表示图像偏移结束的变焦倍率,需要小于或等于第一目标微距摄像头和第二目标微距摄像头的切换倍率。
当zoomcur=zoompre=zoomstart时,offsetpre=0,offset为预先标定的图像偏移值。zoomstart表示图像偏移开始的变焦倍率。zoomstart和zoomend均为预先设定的值。zoomstart大于等于第一目标微距摄像头的最小变焦倍率,且小于zoomend。当变焦倍率大于zoomend时,图像偏移值为offset。
由上式可知,当变焦倍率不变即zoomcur=zoompre时,offsetcur=offsetpre,即offsetcur保持不变。这样可以避免图像特征匹配得到offset的误差导致送显图像偏移。
当变焦倍率增大时,offset线性增大。当zoomcur≥zoomend时,offsetcur=offset,此时,从第一目标微距摄像头切换至第二目标微距摄像头时可以让送显图像的视场中心保持不变,摄像头切换时的画面过渡更平滑自然。
为了更好地介绍图像中心对齐方案,下面结合图3D和图4示出的超广角预览流程示意图进行介绍说明。
如图3D和图4所示,电子设备100具体为手机31,且手机31包括主摄像头、长焦微距摄像头和超广角微距摄像头。此时,上述第一目标微距摄像头为超广角微距摄像头,焦段为0.5x~3.5x;上述第二目标微距摄像头为长焦微距摄像头,焦段为3.5x~15x。摄像头切换倍率为3.5x。zoomstart为1x,zoomend为3.5x。
手机31在拍照预览状态下,检测到连续N帧图像的拍摄距离均小于第一阈值,则确定满足自动进入微距拍摄模式的条件,并自动进入微距拍摄模式,开启长焦微距摄像头和超广角微距摄像头,通过长焦微距摄像头采集长焦图像,通过超广角微距摄像头采集广角图像。
在进入微距拍摄模式时,变焦倍率为1x,即zoomcur=zoompre=zoomstart=1,offsetpre=0,offset为预先标定的图像偏移值。
在变焦倍率为1x时,图像偏移值为初始偏移值。长焦图像经过ISP处理后,输出降采样后的长焦缩小图。广角图像经过ISP模块时,ISP模块会根据变焦倍率和图像偏移值进行图像偏移裁剪,获得裁剪图像。此时,根据初始偏移值,对广角图像进行图像偏移裁剪,获得裁剪图像,并将该裁剪图像作为变焦倍率为1x的广角预览图像,
即将该裁剪图像显示在预览界面322。此外,手机31还将裁剪图像进行降采样处理,以获得广角缩小图,并将长焦缩小图和广角缩小图进行图像特征匹配,根据图像特征匹配,计算长焦图像中心和广角图像中心之间的图像偏移值,再根据该图像偏移值进行偏移值更新。
用户通过拖动变焦控件315,从1x变焦至3.5x的过程中,手机31针对每帧图像执行图4的流程。
在当前帧图像的变焦倍率为1.5x时,手机31通过ISP对长焦图像进行降采样,获得长焦缩小图;根据更新后的图像偏移值,对广角图像进行图像偏移裁剪,获得裁剪图像,将裁剪图像显示在预览界面326;还将裁剪图像进行降采样,获得广角缩小图;再将广角缩小图和长焦缩小图进行图像特征匹配,根据图像特征匹配结果和当前变焦倍率,通过上述式1计算出当前帧图像的图像偏移值,并根据当前帧图像的图像偏移值进行偏移值更新。
在当前帧图像的变焦倍率为3.5x时,手机31确定当前变焦倍率达到摄像头切换倍率,则将长焦图像作为送显图像,即将长焦图像显示在预览界面327,以将预览界面的画面从超广角微距摄像头切换至长焦微距摄像头。
在上述场景,在微距拍摄模式的变焦过程中,超广角预览时通过图像偏移值对广角图像进行偏移裁剪,以通过FOV偏移裁剪向长焦FOV作配准偏移,使得长焦FOV尽量处于超广角裁剪后的FOV中心,进而使得从广角焦段切换至长焦焦段时,图像画面过渡更平滑自然,用户微距拍摄体验更佳。
需要说明的是,本申请的另一些实施例中,电子设备100在微距拍摄模式的变焦过程中,可以不用计算当前帧图像的图像偏移值,不用根据图像偏移值进行图像偏移裁剪。此时,电子设备100可以直接将当前微距摄像头的全FOV图像或者部分FOV图像作为送显图像。
电子设备100处于微距拍摄模式时,摄像头和拍摄主体之间的拍摄距离较近,当变焦倍率较大或处于高焦段时,预览FOV较小,使得用户的观察视场容易被电子设备100的屏幕遮挡,并且抖动时容易丢失拍摄主体,进而导致微距拍摄的交互和构图困难,影响用户体验。
针对微距拍摄的交互和构图困难的问题,本申请实施例在微距拍摄模式的预览画面上叠加显示图像导航画面,并且图像导航画面的FOV大于预览画面的FOV。这样,通过更大FOV的图像导航画面,方便用户寻找微距拍摄主体并进行构图调整,用户交互和构图更加便捷,微距拍摄体验更佳。
在本申请的一些实施例中,图像导航画面和预览画面可以是同一个微距摄像头采集的图像。此时,电子设备100可以包括至少一个微距摄像头。电子设备100可以将微距摄像头捕获的全FOV画面作为图像导航画面,将从全FOV画面中裁剪的部分FOV画面作为预览画面,进而使得图像导航画面的FOV大于预览画面的FOV。当然,电子设备100也可以将微距摄像头捕获的部分FOV画面作为图像导航画面,只需要让导航画面对应的部分FOV画面的视场角大于预览画面对应的部分FOV画面的视场角。
示例性地,参见图5示出的单微距摄像头的图像导航流程示意图,电子设备100在进入微距拍摄模式后,开启微距摄像头,并获取微距摄像头捕获的图像;通过ISP
对微距摄像头捕获的全FOV图像进行图像裁剪,以从全FOV图像中裁剪出部分FOV图像,并将裁剪得到的部分FOV图像作为预览画面;还通过ISP对微距摄像头捕获的全FOV图像进行降采样,以获得ISP输出的缩小图,并且根据部分FOV图像在全FOV图像中的位置,在缩小图中标记出部分FOV图像的位置。部分FOV图像在全FOV图像中的位置可以由图像裁剪过程得到;将标记后的缩小图作为导航画面;最后,将预览画面和导航画面叠加显示。
例如,参见图6示出的微距拍摄的图像导航示意图,手机61处于微距拍摄模式,显示拍照预览画面611,并且在拍照预览画面611上叠加显示了导航窗口612。导航窗口612用于显示导航画面,且导航画面上通过标记框613标记预览画面611在全FOV图像中的位置。此外,图6中的变焦倍率为Ax,A的数值是任意的。
通过观察导航窗口612中的导航画面,用户可以得知预览画面611在全FOV图像的位置,方便用户进行微距构图调整和寻找微距拍摄主体。
需要说明的是,电子设备100可以在变焦倍率较大或高焦段时,才在预览画面上叠加显示导航画面。例如,在图6中,手机61包括长焦微距摄像头,A的数值大于10,即当前变焦倍率大于10x,处于长焦高倍率,也即手机61在高焦段时,在预览画面上叠加显示导航画面。又例如,图6中的手机61包括超广角微距摄像头,A的数值处于1.5~3.5,即当前变焦倍率处于1.5x~3.5x,属于超广角微距摄像头的高倍率焦段,当然,电子设备100也可以不考虑变焦倍率和焦段的数值,在进入微距拍摄模式后就在预览画面上叠加显示导航画面。
需要指出的是,图像导航画面和预览画面是同一个微距摄像头捕获的画面时,如果电子设备包括至少两个微距摄像头,电子设备不仅可以基于至少两个微距摄像头进行摄像头微距切换接力,以实现更广焦段的微距拍摄,并且在微距拍摄的变焦过程中,还可以基于单个微距摄像头进行图像导航。
此时,电子设备100将当前使用的微距摄像头的部分FOV图像作为预览画面,将该微距摄像头的全FOV图像作为预览画面。
例如,电子设备包括长焦微距摄像头和超广角微距摄像头。在变焦倍率处于0.5x~3.5x时,电子设备使用超广角微距摄像头进行微距拍摄,将超广角微距摄像头捕获的部分FOV画面作为预览画面,并将超广角微距摄像头捕获的全FOV画面作为导航画面。在变焦倍率大于3.5x时,电子设备从超广角微距摄像头切换至长焦微距摄像头后,使用长焦微距摄像头进行微距拍摄,并且,将长焦微距摄像头捕获的部分FOV画面作为预览画面,将长焦微距摄像头捕获的全FOV画面作为导航画面。
需要指出的是,图像导航画面和预览画面是同一个微距摄像头捕获的画面时,除了可以将微距摄像头捕获的全FOV画面作为导航画面之外,还可以将微距摄像头捕获的部分FOV画面作为导航画面,只需要让导航画面的FOV大于预览画面的FOV即可。
在本申请的另一些实施例中,图像导航画面和预览画面也可以不是同一个微距摄像头采集的图像,并且,图像导航画面的微距摄像头的FOV可以大于预览画面的微距摄像头的FOV。此时,电子设备100可以包括至少两个微距摄像头。例如,手机包括超广角微距摄像头和长焦微距摄像头,超广角微距摄像头的FOV大于长焦微距摄像头的FOV,将超广角微距摄像头捕获的画面作为图像导航画面,将长焦微距摄像头捕获
的画面作为预览画面。
当然,导航画面的微距摄像头的FOV也可以小于预览画面的微距摄像头的FOV,此时,可以通过图像裁剪以保证图像导航画面的FOV大于预览画面的FOV。即对导航画面对应的微距摄像头捕获的全FOV画面进行裁剪,以获得导航画面对应的裁剪图像;对预览画面对应的微距摄像头的全FOV画面进行裁剪,以获得预览画面对应的裁剪图像;导航画面对应的裁剪图像的FOV大于预览画面对应的裁剪图像的FOV。
需要指出的是,除了可以将微距摄像头捕获的全FOV画面作为导航画面之外,还可以将微距摄像头捕获的部分FOV画面作为导航画面,只需要让导航画面的FOV大于预览画面的FOV即可。进一步地,将微距摄像头捕获的部分FOV画面作为导航画面时,变焦倍率不同,导航画面的FOV画面的视场角也不同,即可以根据变焦倍率,从全FOV画面中裁剪出不同FOV的画面作为导航画面。
在基于至少两个微距摄像头的图像导航方案中,电子设备100可以在微距拍摄模式的变焦过程中,基于至少两个微距摄像头进行切换接力。这样,不仅实现了更广焦段的微距摄影,还通过更大FOV的图像导航画面,提高了用户微距构图调整和寻找微距拍摄主体的便捷性。
示例性地,参见图7示出的图像导航的一种示意图,此时,电子设备100为手机71,且手机71包括主摄像头、长焦微距摄像头和超广角微距摄像头。
如图7所示,手机71检测到针对相机711的点击操作后,响应于该点击操作,显示拍照预览界面712。拍照预览界面712包括拍照主体713、变焦条714和变焦控件715。此时,拍照预览界面712显示的是主摄像头捕获的画面,该画面是预览画面,且当前变焦倍率为1x。
手机71在拍摄预览状态下,检测与拍照主体713之间的距离。当检测到连续N帧图像的拍摄距离均小于第一阈值,手机71则确认满足自动进入微距拍摄模式的条件,自动进入微距拍摄模式,并显示拍照预览界面716。拍照预览界面716显示的是超广角微距摄像头捕获的画面。拍照预览界面716包括超广角微距快捷控件717、长焦微距快捷控件718以及提示信息719。此时,手机71在进入微距拍摄模式时,默认使用超广角微距摄像头,则超广角微距快捷控件717处于开启状态,长焦微距快捷控件718处于关闭状态。手机71可以在微距拍摄模式下持续显示提示信息719,也可以在持续显示提示信息719一段时间后,取消显示提示信息719。
在进入微距拍摄模式后,用户向右拖动变焦控件715,将变焦倍率从1x增大至3.5x。当然,用户也可以通过点击长焦微距快捷控件718以快速切换至长焦微距。手机71响应于用户针对变焦控件715的拖动操作,确定当前变焦倍率为3.5x,达到摄像头切换倍率,则显示拍照预览界面720。拍照预览界面720显示的是长焦微距摄像头捕获的画面。即在达到摄像头切换倍率时,手机71的拍照预览画面从超广角微距摄像头捕获的画面切换为长焦微距摄像头捕获的画面,这样,通过超广角微距摄像头和长焦微距摄像头的切换接力,实现了超广角焦段至长焦焦段的微距摄影。
手机71从超广角微距摄像头切换至长焦微距摄像头后,从超广角微距模式切换至长焦微距模式。因此,在变焦倍率达到3.5x时,拍照预览界面720上的超广角微距快捷控件717处于关闭状态,长焦微距快捷控件718处于开启状态。
此外,手机71还在切换至长焦微距摄像头后,在拍照预览界面720上叠加显示导航窗口721,导航窗口721用于显示导航画面。并且,使用矩形框722标记预览画面在导航画面中的位置。导航窗口721显示的导航画面为超广角微距摄像头捕获的界面,此时,可以将超广角微距摄像头捕获的全FOV画面作为导航画面,也可以将超广角微距摄像头捕获的全FOV画面裁剪到合适的视场(例如,78°)后,再将裁剪得到的图像作为导航画面。在微距拍摄模式的变焦过程中,手机71可以通过计算长焦图像的中心和超广角图像的中心之间的图像偏移值,获得预览画面在超广角图像中的位置,并通过矩形框722标识预览画面和超广角图像的相对位置关系。这样,在超广角微距摄像头和长焦微距摄像头进行切换接力,以实现更广焦段的微距摄影的基础上,在将预览画面从超广角微距摄像头切换至长焦微距摄像头时,通过将更大FOV的微距摄像头(即超广角微距摄像头)捕获的画面作为导航画面,便于用户通过更大FOV的导航画面进行微距构图和寻找微距拍摄目标。
当然,电子设备100也可以不用至少两个微距摄像头进行切换接力。此时,电子设备100在进入微距拍摄模式后,只使用一个微距摄像头进行微距摄影,不用基于多个微距摄像头进行微距摄像头的切换接力,而是使用更大FOV的微距摄像头进行图像导航。
例如,参见图8示出的图像导航的另一种示意图,此时,电子设备100为手机81,且手机81包括主摄像头、长焦微距摄像头和超广角微距摄像头。长焦微距摄像头只用于微距摄影,超广角微距摄像头不用于微距摄影,只用于图像导航。
如图8所示,手机81检测到针对相机811的点击操作后,响应于该点击操作,显示拍照预览界面812,在该界面显示预览画面。拍照预览界面812包括拍照主体813、变焦条814和变焦控件815。此时,拍照预览界面812显示的是主摄像头捕获的画面,当前变焦倍率为1x。
手机81在拍摄预览状态下,检测与拍照主体813之间的距离。当检测到连续N帧图像的拍摄距离均小于第一阈值,手机81则确认满足自动进入微距拍摄模式的条件,自动进入微距拍摄模式,并显示拍照预览界面816。拍照预览界面816显示的是长焦微距摄像头捕获的画面。拍照预览界面816包括提示信息817、导航窗口818和矩形框819。
导航窗口818用于显示导航画面,此时导航画面是超广角微距摄像头捕获的画面。手机81通过计算超广角图像的中心和长焦图像的中心之间的图像偏移值,获得预览画面在图像导航画面中的位置,并通过矩形框819标识预览画面和导航画面之间的相对位置关系。
需要指出的是,本申请实施例提供的基于至少两个不同FOV的摄像头的导航方案,可以应用于微距拍摄模式,并且,在应用于微距拍摄模式时,至少两个摄像头可以包括部分微距摄像头,部分非微距摄像头。例如,电子设备包括长焦微距摄像头和广角摄像头,此时,使用长焦微距摄像头进行微距摄影,并使用广角摄像头进行图像导航,即将长焦微距摄像头捕获的画面作为预览画面,将广角摄像头捕获的画面作为导航画面;也可以应用于非微距拍摄模式。并且,至少两个不同FOV的摄像头可以不是微距摄像头。例如,在普通拍照模式下,手机可以变焦倍率达到15x时,使用长焦摄像头
捕获的画面作为预览画面,并在拍照预览界面叠加显示导航窗口,该导航窗口显示的导航画面是超广角摄像头捕获的画面。
还需要指出的是,用于标识预览画面和导航画面之间的标识图案并不限于上文提及的矩形框,并且该标识图案的显示位置也不限于上文提及的位置,在此不对标识图案和标识图案的显示位置、显示方式等作限定。
需要说明的是,基于上述至少两个微距摄像头的图像导航方案,在基于至少两个微距摄像头进行切换接力时,可以不用通过上述图像中心对齐方案进行图像偏移裁剪,但这样在摄像头切换时画面过渡不平滑、不自然。
进一步地,基于上述至少两个微距摄像头的图像导航方案,在基于至少两个微距摄像头进行切换接力时,为了保证摄像头切换时画面过渡更平滑自然,电子设备100还可以通过上述图像中心对齐方案,根据图像偏移值进行图像偏移裁剪。此时,电子设备100在进入微距拍摄模式后,默认使用第一微距摄像头进行微距拍摄,在预览界面显示第一微距摄像头捕获的画面,作为预览画面。可以理解的是,电子设备100可以进入微距拍摄模式后就在预览画面上叠加显示导航画面;也可以在变焦倍率达到目标倍率时,才在预览画面上叠加显示导航画面。下面以后者作为示例进行介绍说明。
在微距拍摄模式的变焦过程中,电子设备100获取当前变焦倍率,判断当前变焦倍率是否达到摄像头切换倍率,以及是否达到目标倍率;如果当前变焦倍率达到摄像头切换倍率,且达到目标倍率,则从第一微距摄像头切换至第二微距摄像头,即预览画面从第一微距摄像头切换为第二微距摄像头,并且,在预览画面上叠加显示第一微距摄像头捕获的画面,作为图像导航画面。第一微距摄像头的FOV大于第二微距摄像头的FOV。另外,在变焦至摄像头切换倍率的过程中,还可以通过上述图像中心对齐方案,计算当前变焦倍率下第一微距摄像头的图像中心和第二微距摄像头的图像中心之间的图像偏移值,并根据图像偏移值,标识导航画面和预览画面之间的相对位置关系,还根据图像偏移值,对第一微距摄像头捕获的图像进行图像偏移裁剪,将获得的裁剪图像作为送显的预览图像,以保证从第一微距摄像头切换至第二微距摄像头时,画面过渡更自然平滑。
示例性地,下面结合图9示出的长焦低中倍率图像导航方案的一种示意图,以及图10示出的长焦低中倍率图像导航方案的一种流程示意图进行介绍说明。
此时,电子设备100为手机91,且手机91包括主摄像头、长焦微距摄像头和超广角微距摄像头。目标倍率为3.5x。
如图9所示,手机91检测到针对相机911的点击操作后,响应于该点击操作,显示拍照预览界面912。拍照预览界面912包括变焦条914和变焦控件915,还是包括拍摄主体913。此时,拍照预览界面912显示的是主摄像头捕获的画面,当前变焦倍率为1x。
手机91在拍摄预览状态下,检测与拍照主体913之间的距离。当检测到连续N帧图像的拍摄距离均小于第一阈值,手机91则确认满足自动进入微距拍摄模式的条件,自动进入微距拍摄模式,并显示拍照预览界面916。拍照预览界面916包括超广角微距快捷控件917、长焦微距快捷控件918以及提示信息919。此时,手机91在进入微距拍摄模式时,默认使用超广角微距摄像头,则超广角微距快捷控件917处于开启状
态,长焦微距快捷控件918处于关闭状态。
手机91在进入微距拍摄模式后,开启超广角微距摄像头和长焦微距摄像头,获取通过超广角微摄像头捕获的超广角图像和长焦微距摄像头的长焦图像。
在刚刚进入微距拍摄模式时,手机91根据初始偏移值,对超广角微距摄像头采集的图像进行图像偏移裁剪,获得裁剪图像,并将该裁剪图像作为送显图像,即将该裁剪图像显示在拍照预览界面916,也即,手机91在进入微距拍摄模式后,预览画面从主摄像头捕获的画面切换至超广角微距摄像头捕获的画面。
在微距拍摄模式下,用户可以拖动在变焦条914上拖动变焦控件915,以改变变焦倍率。在变焦过程中,手机91实时获取当前变焦倍率,并判断当前变焦倍率是否达到摄像头切换倍率,以及是否达到目标倍率。
如图9所示,手机91在进入微距模式拍摄后,显示拍照预览界面916,拍照预览界面916显示当前变焦倍率为1x。用户向右拖动变焦控件915,将变焦倍率从1x变焦至1.5x,显示拍照预览界面920。此时,变焦倍率还未达到摄像头切换倍率和目标倍率,手机91继续使用超广角微距摄像头进行微距摄影。手机91响应于用户针对变焦控件915的拖动操作,在变焦过程中执行图像中心对齐方案,以裁剪出送显图像。具体地,针对长焦图像,手机91通过ISP进行降采样处理,获得ISP输出的长焦缩小图;针对超广角图像,手机91根据更新的图像偏移值,通过ISP进行图像偏移裁剪,以获得裁剪图像,并将裁剪图像作为送显图像,即将该裁剪图像作为超广角预览图像;另外,还通过ISP对裁剪图像进行降采样处理,获得超广角缩小图,并将超广角缩小图和长焦缩小图进行图像特征匹配,根据图像特征匹配结果和当前变焦倍率,计算出长焦图像中心和超广角图像中心之间的图像偏移值,并根据该图像偏移值进行偏移值更新。
用户继续向右拖动变焦控件915,将变焦倍率从1.5x增大至3.5x。手机91响应于用户针对变焦控件915的拖动操作,确定当前变焦倍率为3.5x,达到了摄像头切换倍率和目标倍率,需要进行摄像头切换和图像导航画面叠加显示。
具体地,如图10所示,针对长焦图像,手机91通过ISP对长焦图像进行数字变焦裁剪,获得长焦裁剪图像,将该长焦裁剪图像作为长焦预览界面,即将长焦裁剪图像作为预览画面显示在拍照预览界面921。并且,手机91还通过ISP对长焦裁剪图像进行降采样处理,获得长焦缩小图。针对超广角图像,手机91根据更新的图像偏移值,通过ISP对超广角图像进行图像偏移裁剪,获得超广角裁剪图像,并对超广角裁剪图像进行降采样处理,获得超广角缩小图。
然后,手机91将超广角缩小图和长焦缩小图进行图像特征匹配,根据图像特征匹配结果和当前变焦倍率,计算超广角图像中心和长焦图像中心之间的图像偏移值,并根据该图像偏移值进行偏移值更新。另外,手机91还根据图像偏移值,标记长焦裁剪图像在超广角裁剪图像中的位置,将标记后的超广角裁剪图像进行降采样处理,获得已标记的缩小图。将该已标记的缩小图作为超广角导航画面显示叠加显示在长焦预览界面上。
如图9所示,手机91将长焦裁剪图像显示在拍照预览界面921,以让预览画面从超广角微距摄像头切换为长焦微距摄像头,实现微距摄像头的切换接力。并且,手机
91还将已标记的缩小图叠加显示在预览界面上,具体如图9中的图像导航窗口922所示,即图像导航窗口922显示的是已标记的缩小图,作为导航画面,而矩形框923用于标识预览画面在导航画面中的位置。在拍照预览界面921中,手机91已从超广角微距切换至长焦微距,故超广角微距快捷控件917处于关闭状态,长焦微距快捷控件918处于开启状态。
在从超广角微距切换至长焦微距之后,用户继续向右拖动变焦控件915,以将变焦倍率从3.5x增大至4x。手机91响应于用户针对变焦控件915的拖动操作,确定当前变焦倍率为4x,处于长焦微距摄像头的焦段。此时,手机91执行如图10所示的流程,获得长焦裁剪图像,并在拍照预览界面924上显示该长焦裁剪图像;并根据图像偏移值,标记长焦裁剪图像在超广角裁剪图像中的位置,以标识长焦预览画面在超广角导航画面中的位置,并将已标识的缩小图显示在图像导航窗口922中。
用户还可以继续拖动变焦控件915,以增大变焦倍率。当变焦倍率大于10x时,手机91可以继续使用超广角微距摄像头捕获的画面作为图像导航画面,或者在变焦倍率超出长焦焦段时,不显示导航画面。但是,在高倍率下如果继续使用超广角微距摄像头进行导航,导航画面上用于标识的矩形框较小,不利于高倍率长焦画面的精确导航。因此,为了实现高倍率长焦画面的精确导航,手机91也可以在变焦倍率大于10x时,使用长焦微距摄像头捕获的长焦全FOV画面进行导航画面,使用长焦微距摄像头捕获的长焦部分FOV画面作为预览画面。
另外,从图9可以看出,在变焦倍率处于超广角微距摄像头的焦段即0.5x~3.5x,手机91在微距拍摄的变焦过程中,没有在预览画面上叠加显示导航画面。在另一些实施例中,手机91也可以在超广角微距摄像头的焦段进行图像导航画面的叠加显示。但是,在超广角微距摄像头的低中倍率焦段(例如,0.5x~1.5x)时,预览画面的FOV还较大,用户还可以比较便捷地进行微距构图调整和寻找微距拍摄目标,因此,在超广角微距摄像头的低中倍率焦段可以不显示导航画面。当变焦倍率处于超广角微距摄像头的高倍率焦段(例如,1.5x~3.5x)时,预览画面的FOV较小,微距构图调整和寻找微距拍摄目标的便捷性较差,手机91可以通过叠加显示导航画面,以提高用户微距拍摄的交互体验。
示例性地,下面结合图11示出的图像导航的又一种示意图,图12示出的超广角高倍率导航方案流程示意图,以及图13示出的长焦高倍率导航方案流程示意图进行介绍说明。
此时,电子设备100为手机111,且手机111包括主摄像头、长焦微距摄像头和超广角微距摄像头。摄像头切换倍率为3.5x,目标倍率为1.5x。
如图11所示,手机111检测到针对相机1111的点击操作后,响应于该点击操作,显示拍照预览界面1112。拍照预览界面1112包括拍摄主体1113、变焦条1114和变焦控件1115。此时,拍照预览界面1112显示的是主摄像头捕获的画面,作为预览画面,当前变焦倍率为1x。
手机111在拍摄预览状态下,检测与拍照主体1113之间的距离。当检测到连续N帧图像的拍摄距离均小于第一阈值,手机111则确认满足自动进入微距拍摄模式的条件,自动进入微距拍摄模式,并显示拍照预览界面1116。拍照预览界面1116包括超
广角微距提示信息1117。此时,手机111在进入微距拍摄模式时,开启超广角微距摄像头和长焦微距摄像头,获取通过超广角微摄像头捕获的超广角图像和长焦微距摄像头捕获的长焦图像。并且,手机111默认使用超广角微距摄像头进行微距拍摄,拍照预览界面1116显示的是超广角微距摄像头捕获的画面。
在刚刚进入微距拍摄模式时,手机111根据初始偏移值,对超广角微距摄像头采集的图像进行图像偏移裁剪,获得裁剪图像,并将该裁剪图像作为送显图像,即将该裁剪图像显示在拍照预览界面1116,也即,手机111在进入微距拍摄模式后,预览画面从主摄像头捕获的画面切换至超广角微距摄像头捕获的画面。
在变焦倍率为1x时,变焦倍率落入超广角微距摄像头的焦段,且属于超广角低中倍率。超广角低中倍率范围为0.5x~1.5x,超广角高倍率范围为1.5x~3.5x。因此,手机111不在预览画面上叠加显示导航画面。
用户通过拖动变焦控件1115,以将变焦倍率从1x增大至1.5x。手机111响应于针对变焦控件1115的拖动操作,确定当前变焦倍率为1.5x,达到目标倍率,未达到摄像头切换倍率,且属于超广角高倍率范围,使用超广角全FOV画面作为导航画面,超广角部分FOV作为预览画面。此时,手机111执行如图12所示的流程,以实现超广角高倍率导航。
具体来说,针对长焦图像,手机111通过ISP对长焦图像进行降采样,以获得长焦缩小图。针对超广角图像,手机111根据更新后的图像偏移值,通过ISP对超广角图像进行图像偏移裁剪,获得裁剪图像,并将该裁剪图像作为超广角预览画面,即将该裁剪图像显示在拍照预览界面1118;还通过ISP对裁剪图像进行降采样,以获得超广角缩小图,并将超广角缩小图和广角缩小图进行图像特征匹配,根据图像特征匹配和当前变焦倍率,计算超广角图像中心和长焦图像中心之间的图像偏移值,根据该图像偏移值进行偏移值更新。另外,还对未裁剪的超广角图像进行降采样,获得缩小图,再根据更新后的图像偏移值,在缩小图中标记出超广角部分FOV(即裁剪图像)在超广角全FOV图像中的位置,获得已标记的缩小图,将该已标记的缩小图作为超广角导航画面,叠加显示在超广角预览画面上。如图11所示,拍照预览界面1118上叠加显示了用于显示图像导航画面的图像导航窗口1119和矩形框1120,矩形框1120用于标识超广角预览画面在超广角导航画面中的位置。
用户通过拖动变焦控件1115,以将变焦倍率从1.5x增大至3.5x。手机111响应于针对变焦控件1115的拖动操作,确定当前变焦倍率为3.5x,达到摄像头切换倍率,且属于长焦低中高倍率,则需要进行摄像头切换,并使用超广角画面作为导航画面,使用长焦画面作为预览画面。长焦低中倍率范围为3.5x~10x,长焦高倍率范围为大于10x。此时,手机111执行如图10所示的流程,获得长焦预览画面和超广角导航画面,并将超广角导航画面叠加显示在长焦预览画面上。如图11所示,在变焦至3.5x时,手机111显示拍照预览界面1121,拍照预览界面1121上叠加显示有导航窗口1119和矩形框1120,此时,导航窗口1119显示的导航画面为根据图10所示的流程确定出的超广角导航画面,预览画面为根据图10所示的流程确定出的长焦预览画面。
用户通过拖动变焦控件1115,以将变焦倍率从3.5x增大至12x。手机111响应于针对变焦控件1115的拖动操作,确定当前变焦倍率为12x,属于长焦高倍率,需要使
用长焦全FOV画面作为导航画面,使用长焦部分FOV画面作为预览画面。此时,手机111可以执行如图13所示的流程,以实现长焦高倍率导航。
具体来说,针对长焦全FOV图像,手机111通过ISP进行降采样处理,获得ISP输出的缩小图;另外,还对长焦全FOV图像进行数字变焦裁剪,以从长焦全FOV图像中裁剪出长焦部分FOV图像,并将长焦部分FOV图像作为长焦预览画面,显示在拍照预览界面1122上。此外,手机111还根据裁剪位置,标记裁剪的部分FOV图像在全FOV图像中的位置,以获得长焦导航画面,并将长焦导航画面显示在拍照预览界面1122上的图像导航窗口1119上。
需要说明的是,在图像导航方案中,电子设备100的微距摄像头可以是定焦摄像头,也可以是连续变焦摄像头,在此不作限定。
在上述微距拍摄场景下,电子设备100可以基于至少两个微距摄像头进行切换接力,以实现更广焦段的微距摄影;还可以在微距摄影中,通过在预览画面上叠加显示更大FOV的导航画面,以提高用户进行微距构图调整和寻找微距拍摄目标的便捷性。
当用户通过上述微距摄像头切换和图像导航等操作,找到合适的微距拍摄角度和微距拍摄目标时,用户可以触发电子设备100执行拍摄操作,以获得微距拍摄图片或微距拍摄视频。
电子设备100拍摄微距图片时,当前变焦倍率不同,拍照出图的方式也可以有所不同。示例性地,电子设备100包括超广角微距摄像头和长焦微距摄像头。当变焦倍率处于超广角低中倍率时,电子设备100使用超广角微距摄像头进行拍照出图;当变焦倍率处于超广角高倍率时,电子设备100使用超广角微距摄像头获取超广角图像,使用长焦微距摄像头获取长焦图像,并将超广角图像和长焦图像进行图像融合,获得融合图像,将融合图像作为输出图像;当变焦倍率处于长焦倍率时,电子设备100则使用长焦微距摄像头进行拍照出图。
在图像融合时,电子设备100可以通过图像特征匹配的方式,确定长焦图像在超广角图像中的位置,即确定超广角图像中与长焦图像对应的区域,该区域为长焦FOV区域;然后,使用长焦图像改善超广角图像中长焦FOV图像的图像质量,进而提高微距拍照图像质量。具体应用中,图像融合方式可以是任意的。例如,直接用长焦图像替换超广角图像中的长焦FOV区域。
例如,参见图14示出的融合图像示意图,融合图像141是变焦倍率为2x对应的融合图像,该融合图像包括长焦FOV区域。在变焦倍率为2x时,电子设备100通过超广角微距摄像头拍摄2x超广角图像,通过长焦微距摄像头拍摄长焦图像;将长焦图像和超广角图像进行图像特征匹配,以确定出超广角图像中的长焦FOV区域,并将长焦图像和超广角图像进行图像融合,获得融合图像141,以通过长焦图像改善超广角图像中长焦FOV区域的图像质量。
示例性地,下面结合图15示出的微距拍摄的一种流程示意图进行介绍说明。
此时,电子设备100包括超广角微距摄像头和长焦微距摄像头。
电子设备100在进入微距拍摄模式后,开启长焦微距摄像头和超广角微距摄像头,并获取这两个微距摄像头采集的图像。在预览阶段,当变焦倍率小于3.5x时,使用超广角送显,即将超广角微距摄像头捕获的画面作为预览画面;当变焦倍率大于或等于
3.5x时,使用长焦送显,广角导航,即使用长焦摄像头捕获的画面作为预览画面,使用超广角微距摄像头捕获的画面作为导航画面。
需要说明的是,关于预览导航部分和图像中心对齐方案,可以参见上文相应内容的介绍说明,在此不再赘述。
另外,电子设备100还通过图像特征匹配方式,计算超广角图像中心和长焦图像中心之间的图像偏移值。
在拍照出图时,当变焦倍率小于2x时,电子设备100使用超广角出图拍照。
例如,参见图16A示出的微距拍照的一种示意图,手机161包括主摄像头、长焦微距摄像头和超广角微距摄像头。
手机161检测到针对相机1611的点击操作后,响应于该点击操作,显示拍照预览界面1612。拍照预览界面1612包括拍摄主体1613、变焦条1614和变焦控件1615,此时变焦条1614处于1x的位置。此时,拍照预览界面显示的是主摄像头捕获的画面,作为预览画面。
手机161在拍照预览状态下,确定满足自动进入微距拍摄模式的条件,则显示拍照预览界面1616。拍照预览界面1616包括提示信息1617。进入微距拍摄模式时,手机161默认使用超广角微距摄像头进行微距拍摄,即从主摄像头切换至超广角微距摄像头,在拍照预览界面1616上显示超广角微距摄像头捕获的画面。
在进入微距拍摄模式后,手机161检测到针对变焦控件1615的拖动操作,并响应于该拖动操作,通过推动变焦马达和对焦马达进行变焦和对焦,并在预览界面上输出图像。
手机161检测到变焦控件1615处于1.5x时,则显示拍照预览界面1618。拍照预览界面1618包括用于显示导航画面的导航窗口1619,以及用于标识预览画面和导航画面的相对位置关系的矩形框1620。此时,变焦倍率1.5x落入在超广角微距摄像头的焦段,手机161使用超广角部分FOV图像作为预览画面,使用超广角全FOV图像作为导航画面。
在变焦倍率为1.5x时,手机161检测到针对拍照控件1621的点击操作,响应于该点击操作,执行拍照操作。此时,由于变焦倍率1.5x小于2x,故使用超广角出图拍照,即将超广角微距摄像头采集的图像作为拍照照片,并将该照片显示在控件1622中。当手机161检测到针对控件1622的点击操作,则显示照片预览画面1623。照片预览画面1623上显示的照片为变焦倍率为1.5x时超广角微距摄像头捕获的图像。
需要说明的是,在微距拍摄模式的变焦过程中,从超广角焦段变焦至长焦焦段的过程中,可以通过上述图像对齐方案进行图像偏移裁剪,让变焦过程中画面过渡更平滑自然。
当变焦倍率为2x~3.5x时,电子设备100根据更新的图像偏移值,确定超广角图像中的长焦FOV区域,并通过超广角图像和长焦图像融合的方式出图拍照。
例如,参见图16B示出的微距拍照的另一种示意图,基于图16A的场景,手机161在拍照预览状态下,检测到针对变焦控件1615的拖动操作,并响应于该拖动操作,并在预览界面上输出图像。
手机161检测到变焦控件1615处于3x时,则显示拍照预览界面1624。拍照预览
界面1624包括用于显示导航画面的导航窗口1625,以及用于标识预览画面和导航画面的相对位置关系的矩形框1626。此时,变焦倍率3x落入在长焦微距摄像头的焦段,手机161使用超广角部分FOV图像作为预览画面,使用超广角全FOV图像作为导航画面。
在变焦倍率为3x时,手机161检测到针对拍照控件1627的点击操作,响应于该点击操作,执行拍照操作。此时,由于变焦倍率3x大于2x且小于3.5x,故使用超广角图像和长焦图像融合的方式进行出图拍照,即将超广角微距摄像头采集的图像和长焦微距摄像头采集的图像进行图像融合,得到融合图像,将融合图像显示在控件1628中。当手机161检测到针对控件1628的点击操作,则显示照片预览画面1629。照片预览画面1629上显示的照片为变焦倍率为3x时,通过图像融合得到的融合图像。
当变焦倍率大于或等于3.5x时,电子设备100使用长焦出图拍照。
例如,参见图16C示出的微距拍照的又一种示意图,基于图16A的场景,手机161在进入微距拍摄模式后,检测到针对变焦控件1615的拖动操作,并响应于该拖动操作,通过推动变焦马达和对焦马达进行变焦和对焦,并在预览界面上输出图像。此时,手机161检测到变焦控件1615处于4x时,则显示拍照预览界面1630。拍照预览界面1630包括用于显示导航画面的导航窗口1631,以及用于标识预览画面和导航画面的相对位置关系的矩形框1632。此时,手机161已从超广角微距摄像头切换至长焦微距摄像头。变焦倍率4x落入在长焦微距摄像头的焦段,手机161使用超广角微距摄像头捕获的画面作为导航画面,使用长焦微距摄像头捕获的画面作为预览画面。
在变焦倍率为4x时,手机161检测到针对拍照控件1633的点击操作,响应于该点击操作,执行拍照操作。此时,由于变焦倍率4x大于3.5x,故使用长焦出图拍照,即将长焦微距摄像头采集的图像作为拍照照片,并将该照片显示在控件1634中。当手机161检测到针对控件1634的点击操作,则显示照片预览画面1635。照片预览画面1635上显示的照片为变焦倍率为4x时长焦微距摄像头捕获的图像。
需要说明的是,在图16A~图16C示出的拍照场景中,手机161在微距拍摄模式的变焦过程中,当变焦倍率达到摄像头切换倍率时,则从超广角微距摄像头切换至长焦微距摄像头。并且,在从超广角焦段变焦至长焦焦段的过程中,通过图像特征匹配的方式,确定超广角图像中心和长焦图像中心之间的图像偏移值,根据图像偏移值进行图像偏移裁剪,实现超广角图像中心和长焦图像中心的对齐。另外,在微距模式下的预览阶段,根据变焦倍率,使用相应的微距摄像头捕获的画面作为导航画面和预览画面。
需要说明的是,上文虽然均是以拍照预览场景进行示例性介绍,但本申请实施例提供的基于至少两个微距摄像头的微距拍摄方案、自动进入和自动退出微距拍摄模式的方案、图像中心对齐方案、以及预览导航方案还可以适用于其它场景,例如,录像预览长焦和录像拍摄场景等,在此不作限定。
示例性地,参见图17A示出的微距录像预览场景的一种示意图,手机171包括主摄像头、长焦微距摄像头和超广角微距摄像头。
如图17A所示,手机171检测到针对相机1711的点击操作后,响应于该点击操作,显示拍照预览界面1712。拍照预览界面1712包括拍摄主体1713、变焦条1714
和变焦控件1715,此时变焦控件1714处于1x的位置。此时,拍照预览界面显示的是主摄像头捕获的画面。
手机171在拍照预览状态下,检测到针对录像控件1716的点击操作,则响应于该点击操作,进入录像模式,并显示录像预览界面1717。录像预览界面1717显示的是主摄像头捕获的画面。
手机171进入录像模式后,在录像预览状态下,检测到连续N帧图像的拍摄距离小于第一阈值,则确定满足自动进入微距拍摄模式的条件,进入微距拍摄模式,并显示录像预览界面1718。录像预览界面1718包括提示信息1719、超广角微距快捷控件1720和长焦微距快捷控件1721。此时,手机171在进入微距拍摄模式时,默认使用超广角微距摄像头,则录像预览界面1718上超广角微距快捷控件1720处于开启状态,长焦微距快捷控件1721处于关闭状态。并且,录像预览界面1718显示的超广角微距摄像头捕获的画面。
用户通过拖动变焦控件1715,将变焦倍率从1x增大至1.5x。手机171响应于针对变焦控件1715的拖动操作,确定当前变焦倍率为1.5x,未达到摄像头切换倍率,则继续使用超广角微距摄像头进行微距拍摄,将超广角微距摄像头捕获的画面显示在录像预览界面1722。此时,当前变焦倍率1.5x落入超广角微距摄像头的焦段,则使用超广角微距摄像头捕获的全FOV画面作为导航画面,将超广角微距摄像捕获的部分FOV画面作为预览画面,即在录像预览界面1722显示用于显示导航画面的导航窗口1723,并用矩形框1724标识预览画面和导航画面之间的相对位置关系。
用户通过拖动变焦控件1715,将变焦倍率从1.5x增大至3.5x。手机171响应于针对变焦控件1715的拖动操作,确定当前变焦倍率为3.5x,达到摄像头切换倍率,则从超广角微距摄像头切换至长焦微距摄像头,将长焦微距摄像头捕获的画面显示在录像预览界面1725,作为预览画面;还将超广角微距摄像头捕获的画面作为导航画面,叠加显示在预览画面上,即显示用于显示导航画面的导航窗口1726,并通过矩形框1727标记长焦图像和超广角图像的相对位置关系。
另外,由于变焦倍率为3.5x时,手机171从超广角微距切换至长焦微距,故录像预览界面1725上超广角微距快捷控件1720处于关闭状态,长焦微距快捷控件1721处于开启状态。
可以理解的是,手机171从超广角焦段变焦至长焦焦段的过程中,可以通过图像特征匹配的方式,计算超广角图像中心和长焦图像中心之间的图像偏移值,并根据该图像偏移值进行图像偏移裁剪,以获得送显图像,进而使得微距变焦过程画面过渡更加自然平滑。
又例如,参见图17B的微距录像的一种示意图,基于图17A的场景,手机171在进入录像模式,并显示录像预览界面1717后,检测到针对控件1742的点击操作,响应于该点击操作,进行录像并显示录像界面1728。此时,录像界面1728显示的主摄像头捕获的画面。
在录像状态下,手机171检测到连续N帧图像的拍摄距离均小于第一阈值,则确定满足自动进入微距拍摄模式的条件,并进入微距拍摄模式,显示录像界面1729。录像界面1729包括提示信息1730、超广角微距快捷控件1731以及长焦微距快捷控件
1732。手机171在进入微距模式时,默认进入超广角微距,则超广角微距快捷控件1731处于开启状态,长焦微距快捷控件1732处于关闭状态。此时,录像画面由主摄像头切换至超广角微距摄像头,即录像界面1729显示的是超广角微距摄像头捕获的画面。
用户通过拖动变焦控件1715,以将变焦倍率从1x增大至1.5x。手机171响应于针对变焦控件1115的拖动操作,确定当前变焦倍率为1.5x,未达到摄像头切换倍率,则继续使用超广角微距摄像头进行录像,将超广角微距摄像头捕获的画面显示在录像界面1733。另外,由于变焦倍率1.5x属于超广角高倍率,则使用超广角微距摄像头捕获的全FOV画面作为导航画面,叠加显示在录像画面上,如录像界面1733上用于显示导航画面的导航窗口1734所示,并通过矩形框1735标识录像画面和导航画面的相对位置关系。
用户通过拖动变焦控件1715,以将变焦倍率从1.5x增大至3.5x。手机171响应于针对变焦控件1715的拖动操作,确定当前变焦倍率为3.5x,则从超广角微距摄像头切换至长焦微距摄像头,将长焦微距摄像头捕获的画面显示在录像界面1736;还将超广角微距摄像头捕获的画面作为导航画面,叠加显示在录像画面上,即显示用于显示导航画面的导航窗口1737,并通过矩形框1738标记录像画面和导航画面之间的相对位置关系。
用户通过拖动变焦控件1715,将变焦倍率从3.5x增大至4x。手机171响应于针对变焦控件1715的拖动操作,确定当前变焦倍率为4x,属于长焦焦段,则继续将长焦微距摄像头捕获的部分FOV画面显示在录像界面1739;另外,还将长焦微距摄像头捕获的全FOV画面作为导航画面,叠加显示在录像画面上,如录像界面1739上用于显示导航画面的导航窗口1740所示,并通过矩形框1741标识录像画面和导航画面的相对位置关系。
需要说明的是,图17B的场景中,手机171在微距拍摄的变焦过程中,还可以通过图像匹配的方式,计算超广角图像中心和长焦图像中心之间的图像偏移值,并根据该图像偏移值进行图像偏移裁剪,以获得送显图像,进而使得从超广角焦段变焦至长焦焦段的过程中,画面过渡更加自然平滑。
本申请实施例提供的电子设备,可以包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行计算机程序时实现如上述方法实施例中任一项的方法。本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行时实现可实现上述各个方法实施例中的步骤。本申请实施例还提供一种芯片***,所述芯片***包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现如上述各个方法实施例所述的方法。所述芯片***可以为单个芯片,或者多个芯片组成的芯片模组。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。此外,在本申请说明书和所附权利要
求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
Claims (32)
- 一种微距拍摄方法,其特征在于,应用于电子设备,所述电子设备包括至少两个微距摄像头,所述方法包括:在微距拍摄模式下,当变焦倍率处于第一倍率范围,在取景框显示第一微距摄像头捕获的画面;当所述变焦倍率为摄像头切换倍率,将所述取景框显示的画面从所述第一微距摄像头捕获的画面切换为第二微距摄像头捕获的画面;当所述变焦倍率大于所述摄像头切换倍率,且处于第二倍率范围,在所述取景框显示所述第二微距摄像头捕获的画面,所述第二倍率范围包括所述摄像头切换倍率;其中,所述第一微距摄像头的焦段和所述第二微距摄像头的焦段不同;所述至少两个微距摄像头包括所述第一微距摄像头和所述第二微距摄像头。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:在所述取景框显示的预览画面上叠加显示导航窗口,所述导航窗口用于显示导航画面;其中,所述导航画面的视场角大于所述预览画面的视场角。
- 根据权利要求2所述的方法,其特征在于,当所述变焦倍率处于所述第二倍率范围,所述导航画面为所述第一微距摄像头捕获的画面,所述预览画面为所述第二微距摄像头捕获的画面。
- 根据权利要求2所述的方法,其特征在于,当所述变焦倍率处于所述第一倍率范围,所述导航画面和所述预览画面均为所述第一微距摄像头捕获的画面;和/或,当所述变焦倍率处于所述第二倍率范围,所述导航画面和所述预览画面均为所述第二微距摄像头捕获的画面。
- 根据权利要求2所述的方法,其特征在于,当所述变焦倍率处于第一倍率范围,所述导航画面和所述预览画面均为所述第一微距摄像头捕获的画面;当所述变焦倍率处于所述第二倍率范围,所述导航画面为所述第一微距摄像头捕获的画面,所述预览画面为所述第二微距摄像头捕获的画面。
- 根据权利要求2所述的方法,其特征在于,当所述变焦倍率处于第一倍率范围,所述导航画面和所述预览画面均为所述第一微距摄像头捕获的画面;当所述变焦倍率处于第三倍率范围,所述导航画面为所述第一微距摄像头捕获的画面,所述预览画面为所述第二微距摄像头捕获的画面;当所述变焦倍率处于第四倍率范围,所述导航画面和所述预览画面均为所述第二微距摄像头捕获的画面;其中,所述第二倍率范围包括所述第三倍率范围和所述第四倍率范围,且所述第三倍率范围包括所述摄像头切换倍率。
- 根据权利要求2至6任一项所述的方法,其特征在于,所述变焦倍率处于第一倍率范围;在取景框显示所述第一微距摄像头捕获的画面,在所述取景框显示的预览画面上叠加显示导航窗口,包括:在所述第一倍率范围的变焦过程中,根据初始标定的图像偏移值,或上一次更新 的图像偏移值,对所述第一微距摄像头采集的图像进行图像偏移裁剪,获得第一裁剪图像;根据所述图像偏移值,通过标识图案标识所述第一裁剪图像在所述第一微距摄像头采集的图像中的位置,获得第一标识图像;将所述第一裁剪图像显示在所述取景框,并在所述取景框的所述导航窗口内显示所述第一标识图像;其中,所述标识图案用于标识所述预览画面和所述导航画面之间的相对位置关系。
- 根据权利要求7所述的方法,其特征在于,所述方法还包括:根据所述第一裁剪图像和所述第二微距摄像头采集的图像进行图像特征匹配,获得第一图像特征匹配结果;根据所述第一图像特征匹配结果和所述第一微距摄像头采集的图像的变焦倍率,确定所述第一微距摄像头采集的图像的图像偏移值,并根据所述第一微距摄像头采集的图像的图像偏移值进行偏移值更新。
- 根据权利要求8所述的方法,其特征在于,所述根据所述第一图像特征匹配结果和所述第一微距摄像头采集的图像的变焦倍率,确定所述第一微距摄像头采集的图像的图像偏移值,包括:通过公式获得所述第一微距摄像头采集的图像的图像偏移值;其中,offset表示所述第一微距摄像头的视场中心到所述第二微距摄像头的视场中心的偏移值,为预先标定的偏移值,或所述图像特征匹配结果;offsetpre表示上一帧图像的图像偏移值,offsetcur表示当前帧图像的图像偏移值;zoompre表示所述上一帧图像的变焦倍率,zoomcur表示当前帧图像的变焦倍率;zoomend表示图像偏移结束的变焦倍率,小于或等于所述摄像头切换倍率;zoomstart表示图像偏移开始的变焦倍率,大于或等于所述第一微距摄像头的最小变焦倍率。
- 根据权利要求2至9任一项所述的方法,其特征在于,所述变焦倍率处于所述第二倍率范围或第三倍率范围;在取景框显示所述第二微距摄像头捕获的画面,在所述取景框显示的预览画面上叠加显示导航窗口,包括:在所述第二倍率范围或所述第三倍率范围的变焦过程中,对所述第二微距摄像头采集的图像进行数字变焦裁剪,获得第二裁剪图像;根据初始标定的图像偏移值或者上一次更新的图像偏移值,通过标识图案标识所述第二裁剪图像在目标图像中的位置,获得第二标识图像;将所述第二裁剪图像显示在所述取景框,并在所述取景框的所述导航窗口内显示所述第二标识图像;其中,所述目标图像为根据初始标定的图像偏移值或更新的图像偏移值,对所述第一微距摄像头采集的图像进行图像偏移裁剪获得的第三裁剪图像;或者,所述第一微距摄像头采集的全视场角图像。
- 根据权利要求10所述的方法,其特征在于,所述方法还包括:根据所述第二裁剪图像和所述目标图像进行图像特征匹配,获得第二图像特征匹配结果;根据所述第二图像特征匹配结果和所述目标图像的变焦倍率,确定所述目标图像的图像偏移值,并根据所述目标图像的图像偏移值进行偏移值更新。
- 根据权利要求10所述的方法,其特征在于,所述变焦倍率处于第四倍率范围;在取景框显示所述第二微距摄像头捕获的画面,在所述取景框显示的预览画面上叠加显示导航窗口,包括:对所述第二微距摄像头采集的图像进行数字变焦裁剪,获得第四裁剪图像;通过标识图案标识所述第四裁剪图像在所述第二微距摄像头采集的图像中的位置,获得第三标识图像;将所述第四裁剪图像显示在所述取景框,并在所述取景框的所述导航窗口内显示所述第三标识图像。
- 根据权利要求1至12任一项所述的方法,其特征在于,所述方法还包括:若所述变焦倍率处于第五倍率范围,检测到拍照操作,则响应于所述拍照操作,输出所述第一微距摄像头采集的图像;若所述变焦倍率处于第六倍率范围,检测到拍照操作,则响应于所述拍照操作,将所述第一微距摄像头采集的图像和所述第二微距摄像头采集的图像进行图像融合,得到融合图像,并输出所述融合图像;若所述变焦倍率处于所述第二倍率范围,检测到拍照操作,则响应于所述拍照操作,输出所述第二微距摄像头采集的图像;其中,所述第一倍率范围包括所述第五倍率范围和所述第六倍率范围。
- 根据权利要求13所述的方法,其特征在于,所述融合图像包括目标区域和非目标区域,所述目标区域的图像质量高于所述非目标区域;所述目标区域为所述第一微距摄像头采集的图像中与所述第二微距摄像头采集的图像对应的区域。
- 根据权利要求1至14任一项所述的方法,其特征在于,所述方法还包括:检测目标摄像头采集的图像的第一拍摄距离;若连续N帧图像的所述第一拍摄距离均小于第一阈值,则从所述目标摄像头切换至默认微距摄像头,并在所述取景框显示所述默认微距摄像头捕获的画面;所述默认微距摄像头为所述第一微距摄像头或所述第二微距摄像头。
- 根据权利要求15所述的方法,其特征在于,所述方法还包括:若连续N帧图像的所述第一拍摄距离均小于所述第一阈值,在所述取景框显示提示信息,所述提示信息用于提示已进入微距拍摄模式。
- 根据权利要求15所述的方法,其特征在于,所述方法还包括:检测当前微距摄像头采集的图像的第二拍摄距离;若连续M帧图像的所述第二拍摄距离均大于第二阈值,则从所述当前微距摄像头切换至所述默认摄像头,并在所述取景框显示所述默认摄像头捕获的画面;所述当前微距摄像头为所述第一微距摄像头或所述第二微距摄像头。
- 根据权利要求1所述的方法,其特征在于,所述取景框还包括第一快捷控件 和第二快捷控件;所述第一快捷控件用于将所述取景框显示的画面从所述第一微距摄像头捕获的画面切换至所述第二微距摄像头捕获的画面;所述第二快捷控件用于将所述取景框显示的画面从所述第二微距摄像头捕获的画面切换至所述第一微距摄像头捕获的画面。
- 一种微距拍摄方法,其特征在于,应用于电子设备,所述方法包括:在微距拍摄模式下,在取景框显示第一微距摄像头捕获的画面,并在所述取景框显示的预览画面上叠加显示导航窗口,所述导航窗口用于显示导航画面,所述导航画面的视场角大于所述预览画面的视场角。
- 根据权利要求19所述的方法,其特征在于,所述导航画面为所述第一微距摄像头捕获的画面;或第二微距摄像头捕获的画面,且所述第二微距摄像头的视场角大于所述第一微距摄像头的视场角。
- 根据权利要求20所述的方法,其特征在于,所述导航画面为所述第一微距摄像头捕获的画面;在取景框显示第一微距摄像头捕获的画面,并在所述取景框显示的预览画面上叠加显示导航窗口,包括:根据初始标定的图像偏移值,或上一次更新的图像偏移值,对所述第一微距摄像头采集的图像进行图像偏移裁剪,获得第一裁剪图像;根据所述图像偏移值,通过标识图案标识所述第一裁剪图像在所述第一微距摄像头采集的图像中的位置,获得第一标识图像;将所述第一裁剪图像显示在所述取景框,并在所述取景框的所述导航窗口内显示所述第一标识图像;其中,所述标识图案用于标识所述预览画面和所述导航画面之间的相对位置关系。
- 根据权利要求21所述的方法,其特征在于,所述方法还包括:根据所述第一裁剪图像和所述第二微距摄像头采集的图像进行图像特征匹配,获得第一图像特征匹配结果;根据所述第一图像特征匹配结果和所述第一微距摄像头采集的图像的变焦倍率,确定所述第一微距摄像头采集的图像的图像偏移值,并根据所述第一微距摄像头采集的图像的图像偏移值进行偏移值更新。
- 根据权利要求22所述的方法,其特征在于,所述根据所述第一图像特征匹配结果和所述第一微距摄像头采集的图像的变焦倍率,确定所述第一微距摄像头采集的图像的图像偏移值,包括:通过公式获得所述第一微距摄像头采集的图像的图像偏移值;其中,offset表示所述第一微距摄像头的视场中心到所述第二微距摄像头的视场中心的偏移值,为预先标定的偏移值,或所述图像特征匹配结果;offsetpre表示上一帧图像的图像偏移值,offsetcur表示当前帧图像的图像偏移值;zoompre表示所述上一帧图像的变焦倍率,zoomcur表示当前帧图像的变焦倍率; zoomend表示图像偏移结束的变焦倍率,小于或等于所述摄像头切换倍率;zoomstart表示图像偏移开始的变焦倍率,大于或等于所述第一微距摄像头的最小变焦倍率。
- 根据权利要求20所述的方法,其特征在于,所述导航画面为所述第二微距摄像头捕获的画面;在取景框显示第一微距摄像头捕获的画面,并在所述取景框显示的预览画面上叠加显示导航窗口,包括:对所述第一微距摄像头采集的图像进行数字变焦裁剪,获得第二裁剪图像;根据初始标定的图像偏移值或者上一次更新的图像偏移值,通过标识图案标识所述第二裁剪图像在目标图像中的位置,获得第二标识图像;将所述第二裁剪图像显示在所述取景框,并在所述取景框的所述导航窗口内显示所述第二标识图像;其中,所述目标图像为根据初始标定的图像偏移值或更新的图像偏移值,对所述第二微距摄像头采集的图像进行图像偏移裁剪获得的第三裁剪图像;或者,所述第二微距摄像头采集的全视场角图像。
- 根据权利要求24所述的方法,其特征在于,所述方法还包括:根据所述第二裁剪图像和所述目标图像进行图像特征匹配,获得第二图像特征匹配结果;根据所述第二图像特征匹配结果和所述目标图像的变焦倍率,确定所述目标图像的图像偏移值,并根据所述目标图像的图像偏移值进行偏移值更新。
- 根据权利要求20所述的方法,其特征在于,所述导航画面为所述第一微距摄像头捕获的画面;在取景框显示第一微距摄像头捕获的画面,并在所述取景框显示的预览画面上叠加显示导航窗口,包括:对所述第一微距摄像头采集的图像进行数字变焦裁剪,获得第四裁剪图像;通过标识图案标识所述第四裁剪图像在所述第一微距摄像头采集的图像中的位置,获得第三标识图像;将所述第四裁剪图像显示在所述取景框,并在所述取景框的所述导航窗口内显示所述第三标识图像。
- 根据权利要求19所述的方法,其特征在于,所述方法还包括:检测到拍照操作,则响应于所述拍照操作,将所述第一微距摄像头采集的图像和第二微距摄像头采集的图像进行图像融合,得到融合图像,并输出所述融合图像;所述融合图像包括目标区域和非目标区域,所述目标区域的图像质量高于所述非目标区域;所述目标区域为所述第一微距摄像头采集的图像中与所述第二微距摄像头采集的图像对应的区域。
- 根据权利要求21至27任一项所述的方法,其特征在于,所述方法还包括:检测目标摄像头采集的图像的第一拍摄距离;若连续N帧图像的所述第一拍摄距离均小于第一阈值,则从所述目标摄像头切换至所述第一微距摄像头,并在所述取景框显示默认微距摄像头捕获的画面。
- 根据权利要求28所述的方法,其特征在于,所述方法还包括:若连续N帧图像的所述第一拍摄距离均小于所述第一阈值,在所述取景框显示提示信息,所述提示信息用于提示已进入微距拍摄模式。
- 根据权利要求21至29任一项所述的方法,其特征在于,所述方法还包括:检测所述第一微距摄像头采集的图像的第二拍摄距离;若连续M帧图像的所述第二拍摄距离均大于第二阈值,则从所述第一微距摄像头切换至默认摄像头,并在所述取景框显示所述默认摄像头捕获的画面。
- 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至18或19至30任一项所述的方法。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至18或19至30任一项所述的方法。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202380013872.9A CN118044215A (zh) | 2022-04-02 | 2023-03-24 | 微距拍摄方法、电子设备和计算机可读存储介质 |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210351277.3 | 2022-04-02 | ||
CN202210351277.3A CN116939357A (zh) | 2022-04-02 | 2022-04-02 | 微距拍摄方法、电子设备和计算机可读存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023185683A1 true WO2023185683A1 (zh) | 2023-10-05 |
Family
ID=88199328
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/083740 WO2023185683A1 (zh) | 2022-04-02 | 2023-03-24 | 微距拍摄方法、电子设备和计算机可读存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (2) | CN116939357A (zh) |
WO (1) | WO2023185683A1 (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117354624B (zh) * | 2023-12-06 | 2024-06-21 | 荣耀终端有限公司 | 摄像头切换方法、设备以及存储介质 |
CN117479008B (zh) * | 2023-12-27 | 2024-05-03 | 荣耀终端有限公司 | 一种视频处理方法、电子设备及芯片*** |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111010506A (zh) * | 2019-11-15 | 2020-04-14 | 华为技术有限公司 | 一种拍摄方法及电子设备 |
CN111183632A (zh) * | 2018-10-12 | 2020-05-19 | 华为技术有限公司 | 图像捕捉方法及电子设备 |
CN111654629A (zh) * | 2020-06-11 | 2020-09-11 | 展讯通信(上海)有限公司 | 摄像头切换方法、装置、电子设备及可读存储介质 |
US20210218898A1 (en) * | 2020-01-10 | 2021-07-15 | Samsung Electronics Co., Ltd. | Method of improving image quality in zoom scenario with single camera, and electronic device including the same |
-
2022
- 2022-04-02 CN CN202210351277.3A patent/CN116939357A/zh active Pending
-
2023
- 2023-03-24 WO PCT/CN2023/083740 patent/WO2023185683A1/zh unknown
- 2023-03-24 CN CN202380013872.9A patent/CN118044215A/zh active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111183632A (zh) * | 2018-10-12 | 2020-05-19 | 华为技术有限公司 | 图像捕捉方法及电子设备 |
CN111010506A (zh) * | 2019-11-15 | 2020-04-14 | 华为技术有限公司 | 一种拍摄方法及电子设备 |
US20210218898A1 (en) * | 2020-01-10 | 2021-07-15 | Samsung Electronics Co., Ltd. | Method of improving image quality in zoom scenario with single camera, and electronic device including the same |
CN111654629A (zh) * | 2020-06-11 | 2020-09-11 | 展讯通信(上海)有限公司 | 摄像头切换方法、装置、电子设备及可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN116939357A (zh) | 2023-10-24 |
CN118044215A (zh) | 2024-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113329160B (zh) | 被配置为处理和显示图像数据的多相机***及具有多相机***的设备 | |
JP6748582B2 (ja) | 撮像装置及びその制御方法、プログラム、並びに記録媒体 | |
CN114157804B (zh) | 一种长焦拍摄的方法及电子设备 | |
JP5775659B2 (ja) | 撮像装置および撮像装置におけるモード切換え方法 | |
WO2023185683A1 (zh) | 微距拍摄方法、电子设备和计算机可读存储介质 | |
US9307153B2 (en) | Method and apparatus for previewing a dual-shot image | |
US8531557B2 (en) | Method, apparatus and system for performing a zoom operation | |
JP4929630B2 (ja) | 撮像装置、制御方法、およびプログラム | |
JP4852652B2 (ja) | 電子ズーム装置、電子ズーム方法、及びプログラム | |
JP6319101B2 (ja) | 画像処理装置、画像処理方法、プログラム | |
JP2011050038A (ja) | 画像再生装置及び撮像装置 | |
JP2007074031A (ja) | 撮像装置、及び、画像処理装置及び方法 | |
WO2022089284A1 (zh) | 拍摄处理方法、装置、电子设备和可读存储介质 | |
JP2013009189A (ja) | 撮影装置および撮像方法 | |
JP5830564B2 (ja) | 撮像装置および撮像装置におけるモード切換え方法 | |
JP6261205B2 (ja) | 画像処理装置 | |
JP7491297B2 (ja) | 情報処理装置、情報処理方法、プログラム | |
US20230421889A1 (en) | Photographing Method and Electronic Device | |
JP2014017665A (ja) | 表示制御装置、表示制御装置の制御方法、プログラムおよび記録媒体 | |
JP2011193066A (ja) | 撮像装置 | |
JP6017656B2 (ja) | 撮像装置および撮像装置におけるモード切換え方法 | |
JP2011211757A (ja) | 電子ズーム装置、電子ズーム方法、及びプログラム | |
JP7394151B2 (ja) | 表示方法 | |
WO2023245385A1 (zh) | 一种拍照预览方法、装置及存储介质 | |
JP5610738B2 (ja) | 表示制御装置、制御方法、プログラム及び記憶媒体 |
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: 23778051 Country of ref document: EP Kind code of ref document: A1 |