CN110691192B - Image processing method, image processing device, storage medium and electronic equipment - Google Patents

Image processing method, image processing device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110691192B
CN110691192B CN201910878358.7A CN201910878358A CN110691192B CN 110691192 B CN110691192 B CN 110691192B CN 201910878358 A CN201910878358 A CN 201910878358A CN 110691192 B CN110691192 B CN 110691192B
Authority
CN
China
Prior art keywords
camera
image
value
electronic device
digital
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910878358.7A
Other languages
Chinese (zh)
Other versions
CN110691192A (en
Inventor
张良玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Realme Chongqing Mobile Communications Co Ltd
Original Assignee
Realme Chongqing Mobile Communications Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Realme Chongqing Mobile Communications Co Ltd filed Critical Realme Chongqing Mobile Communications Co Ltd
Priority to CN201910878358.7A priority Critical patent/CN110691192B/en
Publication of CN110691192A publication Critical patent/CN110691192A/en
Priority to PCT/CN2020/111770 priority patent/WO2021043061A1/en
Application granted granted Critical
Publication of CN110691192B publication Critical patent/CN110691192B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/45Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from two or more image sensors being of different type or operating in different modes, e.g. with a CMOS sensor for moving images in combination with a charge-coupled device [CCD] for still images

Abstract

The application discloses an image processing method, which is applied to electronic equipment, wherein the electronic equipment comprises at least two cameras, the types of the two cameras are different, and the image processing method comprises the following steps: when the two cameras are both in an open state and the lens of the first camera is located at a first position, acquiring a first digital-to-analog conversion code value currently corresponding to the first camera, wherein the first position is the position where the lens of the first camera is located when the first camera acquires a clear image; converting the first digital-to-analog conversion code value into an object distance value of a focusing object; converting the object distance value into a second digital-to-analog conversion code value corresponding to a second camera; and driving the second camera to focus according to the second digital-to-analog conversion code value. The method and the device can improve the efficiency of the electronic equipment for acquiring the image.

Description

Image processing method, image processing device, storage medium and electronic equipment
Technical Field
The present application belongs to the field of image technologies, and in particular, to an image processing method, an image processing apparatus, a storage medium, and an electronic device.
Background
With the continuous development of technology, many electronic devices have two or more cameras. By using the plurality of cameras, the electronic equipment can shoot images with better imaging quality or perform more flexible image processing operation. However, in the related art, the electronic device is inefficient in acquiring images.
Disclosure of Invention
The embodiment of the application provides an image processing method, an image processing device, a storage medium and an electronic device, which can improve the efficiency of acquiring an image by the electronic device.
In a first aspect, an embodiment of the present application provides an image processing method, which is applied to an electronic device, where the electronic device includes at least two cameras, where types of the two cameras are different, and the image processing method includes:
when the two cameras are both in an open state and a lens of a first camera is located at a first position, acquiring a first digital-to-analog conversion code value currently corresponding to the first camera, wherein the first position is the position where the lens of the first camera is located when the first camera acquires a clear image;
converting the first digital-to-analog conversion code value into an object distance value of a focusing object;
converting the object distance value into a second digital-to-analog conversion code value corresponding to a second camera;
and driving the second camera to focus according to the second digital-to-analog conversion code value.
In a second aspect, an embodiment of the present application provides an image processing apparatus, which is applied to an electronic device, where the electronic device includes at least two cameras, where types of the two cameras are different, and the image processing apparatus includes:
the acquisition module is used for acquiring a first digital-to-analog conversion code value currently corresponding to the first camera when the two cameras are both in an open state and the lens of the first camera is located at a first position, wherein the first position is the position where the lens of the first camera is located when the first camera acquires a clear image;
the first conversion module is used for converting the first digital-to-analog conversion code value into an object distance value of a focusing object;
the second conversion module is used for converting the object distance value into a second digital-to-analog conversion code value corresponding to a second camera;
and the driving module is used for driving the second camera to focus according to the second digital-to-analog conversion code value.
In a third aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored, which, when executed on a computer, causes the computer to execute a flow in an image processing method provided by an embodiment of the present application.
In a fourth aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and at least two cameras, where types of the two cameras are different, and the processor is configured to execute a procedure in the image processing method provided in the embodiment of the present application by calling a computer program stored in the memory.
In the embodiment of the application, the first camera and the second camera are both in an open state, and the electronic device can convert a first digital-to-analog conversion code value corresponding to the first camera into an object distance value of a focused object when the lens of the first camera is located at a first position where a clear image can be acquired, convert the object distance value into a second digital-to-analog conversion code value which can be used by the second camera, and drive the second camera to focus by using the second digital-to-analog conversion code value, so that the second camera can acquire the image. Therefore, the embodiment can rapidly acquire the image by using the second camera, namely, the efficiency of acquiring the image by the electronic equipment is improved.
Drawings
The technical solutions and advantages of the present application will become apparent from the following detailed description of specific embodiments of the present application when taken in conjunction with the accompanying drawings.
Fig. 1 is a schematic flowchart of a first image processing method according to an embodiment of the present application.
Fig. 2 is a schematic flowchart of a second image processing method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a camera and a cache queue thereof according to an embodiment of the present application.
Fig. 4 is a schematic flowchart of a third image processing method according to an embodiment of the present application.
Fig. 5 is a schematic flowchart of the electronic device that determines, according to the scaling value, to obtain a display image by processing an image acquired by using the first camera or the second camera according to the embodiment of the present application.
Fig. 6 to 7 are scene schematic diagrams of an image processing method according to an embodiment of the present application.
Fig. 8 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Fig. 10 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 11 is a schematic structural diagram of an image processing circuit according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
It is understood that the execution subject of the embodiment of the present application may be an electronic device such as a smart phone or a tablet computer.
Referring to fig. 1, fig. 1 is a first flowchart illustrating an image processing method according to an embodiment of the present disclosure. The image processing method can be applied to an electronic device, and the electronic device can comprise at least two cameras. The two cameras may be of different types.
The flow of the image processing method provided by this embodiment may include:
101. when the two cameras are both in an open state and the lens of the first camera is located at a first position, a first digital-to-analog conversion code value currently corresponding to the first camera is obtained, and the first position is the position where the lens of the first camera is located when the first camera obtains a clear image.
With the continuous development of technology, many electronic devices have two or more cameras. By using the plurality of cameras, the electronic equipment can shoot images with better imaging quality or perform more flexible image processing operation. However, in the related art, the electronic device is inefficient in acquiring images.
In the embodiment of the present application, for example, when two cameras of an electronic device are both in an on state and a lens of one of the cameras (i.e., a first camera) is located at a first position, the electronic device may acquire a first digital-to-analog conversion code value (DAC code) currently corresponding to the first camera. The first position is a position where a lens of the first camera is located when the first camera can acquire a clear image.
It should be noted that the state in which both the cameras of the electronic device are turned on means a state in which both the cameras of the electronic device are turned on and image capturing is possible.
Note that, the device for controlling lens focusing in the electronic apparatus is a Voice Coil Motor (VCM). The voice coil motor can convert the current into mechanical force, and the positioning and force control of the voice coil motor are determined by an external controller. The voice coil motor in the electronic device has a corresponding voice coil motor driving circuit (VCM Driver IC). The voice coil motor driving circuit can accurately control the moving distance and the moving direction of the coil in the voice coil motor, so that the lens is driven to move to achieve the focusing effect.
The vcm operates based on ampere's theorem, that is, when the coil in the vcm is conducting, the current generated force pushes the lens fixed on the carrier to move, so as to change the focus distance. It can be seen that the control of the focus distance by the voice coil motor is actually achieved by controlling the current in the coil. In short, the driving circuit of the vcm provides a source power of "current", and after the current is supplied to the coil of the vcm, the magnetic field in the vcm is utilized to generate a force for driving the coil (lens).
The voice coil motor drive circuit is actually a DAC circuit with a control algorithm. The digital position information-containing DAC code value uploaded by the I2C bus can be converted into corresponding output current (the output current corresponding to the DAC code value); and then the output current is converted into a focusing distance through a voice coil motor device. Different output currents form a loop through the voice coil motor, different ampere forces are generated, and the force pushes a lens on the voice coil motor to move. Therefore, the lens of the camera stays at the clearly focused position after focusing is finished, and the camera can acquire the cleaning image when the lens stays at the clearly focused position. The in-focus position has a corresponding digital to analog converted code value (DAC code).
102. And converting the first digital-to-analog conversion code value into an object distance value of the focused object.
For example, after acquiring a first digital-to-analog conversion code value currently corresponding to the first camera, the electronic device may convert the first digital-to-analog conversion code value into an object distance value of the focused object.
103. And converting the object distance value into a second digital-to-analog conversion code value corresponding to the second camera.
For example, after converting the first DAC code value into an object distance value of the focused object, the electronic device may convert the object distance value into a second DAC code value (DAC code) corresponding to another camera (i.e., a second camera).
104. And driving the second camera to focus according to the second digital-to-analog conversion code value.
For example, after obtaining the second digital-to-analog converted code value, the electronic device may drive the second camera to perform focusing according to the second digital-to-analog converted code value.
It can be understood that, in this embodiment of the application, because the first camera and the second camera are both in an on state, and the electronic device can convert a first digital-to-analog conversion code value corresponding to the first camera into an object distance value of a focused object when the lens of the first camera is located at a first position where a clear image can be acquired, convert the object distance value into a second digital-to-analog conversion code value that can be used by the second camera, and drive the second camera to focus by using the second digital-to-analog conversion code value, the second camera can acquire an image. Therefore, the embodiment can rapidly acquire the image by using the second camera, namely, the efficiency of acquiring the image by the electronic equipment is improved.
Referring to fig. 2, fig. 2 is a second flowchart illustrating an image processing method according to an embodiment of the present disclosure. The image processing method can be applied to an electronic device, and the electronic device can comprise two cameras. The two cameras may be of different types. When the electronic equipment is in the shooting interface, the two cameras both acquire images, but the electronic equipment can process the images acquired by only one camera to obtain a display image, wherein the display image is an image for displaying on the shooting interface. That is, when the electronic device is in the shooting interface, both the two cameras of the electronic device are in the open state and respectively shoot the shooting scene to acquire the corresponding images. For example, images captured by the cameras are stored in the corresponding image buffer queues.
For example, as shown in fig. 3, an image captured by one camera of the electronic device is stored in a first image buffer queue, and an image captured by another camera of the electronic device is stored in a second image buffer queue. At a certain moment, the electronic device may only process an image captured by one of the cameras to obtain a display image, and then the camera is a camera for acquiring the display image. For example, at time T1, the electronic device may obtain a most recently stored frame of image from the first image buffer queue, and display the image in the shooting interface as a display image after performing certain processing on the image. At time T2, when the camera in the electronic device for acquiring the display image is switched, the electronic device may acquire the most recently stored frame of image from the second image buffer queue, and display the frame of image in the shooting interface as the display image after performing certain processing on the frame of image.
The flow of the image processing method provided by this embodiment may include:
201. when two cameras of the electronic device are both in an open state, the electronic device acquires a display image by using a first camera, and a lens of the first camera is located at a first position, the electronic device acquires a first digital-to-analog conversion code value currently corresponding to the first camera, wherein the first position is a position where the lens of the first camera is located when the first camera acquires a clear image.
With the continuous development of technology, many electronic devices have two or more cameras. By using the plurality of cameras, the electronic equipment can shoot images with better imaging quality. In the case of multiple cameras, the electronic device sometimes needs to switch between different cameras to capture the desired display image when in the capture interface. When the electronic equipment switches the camera, the display image of the shooting interface is also switched.
However, in the related art, when the electronic apparatus switches the camera, the switching of the display image in the shooting interface is not smooth. For example, the electronic device includes two cameras, wherein one camera a uses a phase detection focusing mode and the other camera B uses a fixed focusing mode. For example, when the camera is in the preview interface, if the camera for acquiring the preview image is switched from a to B, the camera B does not have a focusing function, so that the switching process of the preview image in the preview interface is not smooth, and it is difficult to fix the camera to the focusing screen of the camera a. For another example, camera a of the electronic device uses a phase detection focusing method, and camera B uses a contrast focusing method. Then, when the preview interface is in the preview interface, if the camera for acquiring the preview image is switched from a to B, the camera B uses a contrast focusing method, but the focusing speed of the contrast focusing method is slow, and the focusing process picture is changed, which causes abrupt change of the preview image of the preview interface, and the image of the preview interface has a significant stretching feeling. That is, in the related art, switching of display images in a shooting interface when the electronic apparatus switches the camera is not smooth.
In this embodiment of the application, for example, the electronic device currently processes an image acquired by the first camera to obtain a display image, and when the lens of the first camera is located at the first position, the electronic device may acquire a first digital-to-analog conversion code value (DAC code) currently corresponding to the first camera. The first position is the position where the lens of the first camera is located when the first camera acquires a clear image. That is, the first camera stays at a clearly focused position after focusing is completed, the clearly focused position corresponds to a digital-to-analog conversion code value (DAC code), and the electronic device can obtain the DAC code value and determine the DAC code value as the first DAC code value. In other words, the electronic device processes the image acquired by the first camera to obtain the display image, and then the electronic device can acquire the first digital-to-analog conversion code value currently corresponding to the first camera after the first camera completes each focus.
Note that, the device for controlling lens focusing in the electronic apparatus is a Voice Coil Motor (VCM). The voice coil motor can convert the current into mechanical force, and the positioning and force control of the voice coil motor are determined by an external controller. The voice coil motor in the electronic device has a corresponding voice coil motor driving circuit (VCM Driver IC). The voice coil motor driving circuit can accurately control the moving distance and the moving direction of the coil in the voice coil motor, so that the lens is driven to move to achieve the focusing effect.
The vcm operates based on ampere's theorem, that is, when the coil in the vcm is conducting, the current generated force pushes the lens fixed on the carrier to move, so as to change the focus distance. It can be seen that the control of the focus distance by the voice coil motor is actually achieved by controlling the current in the coil. In short, the driving circuit of the vcm provides a source power of "current", and after the current is supplied to the coil of the vcm, the magnetic field in the vcm is utilized to generate a force for driving the coil (lens).
The voice coil motor drive circuit is actually a DAC circuit with a control algorithm. The digital position information-containing DAC code value uploaded by the I2C bus can be converted into corresponding output current (the output current corresponding to the DAC code value); and then the output current is converted into a focusing distance through a voice coil motor device. Different output currents form a loop through the voice coil motor, different ampere forces are generated, and the force pushes a lens on the voice coil motor to move. Thus, after focusing is completed, the camera will stay in a clearly focused position with a corresponding digital-to-analog converted code value (DAC code).
202. When the camera used for obtaining the display image is switched from the first camera to the second camera, the electronic equipment converts the first digital-to-analog conversion code value into an object distance value of a focusing object, wherein the first camera and the second camera are two cameras of the electronic equipment.
For example, when a camera used for acquiring a display image is switched from a first camera to a second camera, the electronic device may convert a first digital-to-analog converted code value acquired recently into an object Distance value (Distance) of an object to be focused. It is understood that the first camera and the second camera are two cameras that the electronic device has.
203. The electronic device converts the object distance value to a second digital-to-analog converted code value corresponding to the second camera.
For example, after converting the first DAC code value into an object distance value of the object in focus, the electronic device may convert the object distance value into a digital-to-analog converted code value (DAC code) corresponding to the second camera, i.e., a second DAC code value.
204. And according to the second digital-to-analog conversion code value, the electronic equipment drives the second camera to focus so as to keep the display images of the shooting interface consistent before and after the camera is switched.
For example, after obtaining the second digital-to-analog conversion code value, the electronic device may drive the second camera to perform focusing according to the second digital-to-analog conversion code value, so that the display images of the shooting interfaces before and after the camera is switched are kept consistent. That is, the electronic device may drive the second camera to move to the corresponding position according to the second digital-to-analog converted code value. For example, if the clear image obtained by the second camera at the corresponding position is the second image and the clear image obtained by the first camera at the position corresponding to the first dac code value is the first image, then the first image and the second image are the same image and they are the same object in focus.
It can be understood that, in the embodiment of the present application, since both the two cameras acquire images when the electronic device is in the shooting interface, when the cameras for acquiring the display images need to be switched, the electronic device can quickly switch from the first camera to the second camera, so as to save time for separately starting the second camera. When the camera for acquiring the display image is switched, the electronic device may convert a first digital-to-analog conversion code value corresponding to the first camera before switching into an object distance value of the object to be focused, and then convert the object distance value into a second digital-to-analog conversion code value corresponding to the second camera after switching. Therefore, the present embodiment can ensure that the object distances focused by the two cameras are consistent, and the electronic device can rapidly drive the second camera to the corresponding position according to the second digital-to-analog conversion code value, so as to obtain the display image by using the second camera, so that the display images of the shooting interfaces before and after the cameras are switched are kept consistent. That is, the embodiment can improve the fluency of switching the display images in the shooting interface when the camera is switched by the electronic equipment.
Referring to fig. 4, fig. 4 is a third flowchart illustrating an image processing method according to an embodiment of the present disclosure. The image processing method can be applied to an electronic device, and the electronic device can comprise two cameras, such as a first camera and a second camera respectively. The first camera is a standard camera (neither a wide-angle camera nor a telephoto camera), and the second camera is a wide-angle camera.
The first camera and the second camera both use a Phase Detection Autofocus (PDAF) method to perform focusing.
When the electronic equipment is in the preview interface, the first camera and the second camera both acquire images, and the electronic equipment processes the images acquired by one of the cameras to obtain a display image, wherein the display image is an image for displaying on the preview interface and can also be called a preview image. In the present embodiment, as shown in fig. 5, the electronic apparatus determines a camera for acquiring a display image according to a Zoom value (Zoom value). And when the scaling value is smaller than or equal to the preset threshold value, the electronic equipment processes the image acquired by the first camera to obtain a display image. And when the scaling value is larger than the preset threshold value, the electronic equipment processes the image acquired by the second camera to obtain a display image. That is, when the mobile terminal is in the preview interface, the first camera and the second camera are both in an open state, and both the first camera and the second camera shoot images and store the images into corresponding image cache queues. For example, a third image buffer queue corresponds to the first camera, and a fourth image buffer queue corresponds to the second camera. When the electronic device processes the image acquired by the first camera to obtain the preview image, the electronic device may acquire the latest stored frame of image from the third image cache queue, and after performing the preset processing on the image, the electronic device may display the processed image as the preview image on the preview interface. When the electronic device processes the image acquired by the second camera to obtain the preview image, the electronic device may acquire the latest stored frame of image from the fourth image cache queue, and after performing the preset processing on the image, the electronic device may display the processed image as the preview image on the preview interface.
The flow of the image processing method may include:
301. and when the scaling value is smaller than or equal to the preset threshold value, the electronic equipment processes the image acquired by the first camera to obtain a display image.
For example, in this embodiment, after entering the preview interface, the electronic device may obtain a current value of the scaling value, and detect whether the scaling value is less than or equal to a preset threshold. For example, the electronic device detects that the current value of the scaling value is less than or equal to the preset threshold. When it is detected that the scaling value is smaller than or equal to the preset threshold, the electronic device may process the image acquired by the first camera to obtain a preview image.
In one embodiment, the preset threshold may have a value of 6.0. Of course, in other embodiments, the value of the preset threshold may be other values, such as 5.5 or 6.5.
302. When the lens of the first camera is located at a first position, the electronic device obtains a first digital-to-analog conversion code value currently corresponding to the first camera, wherein the first position is the position where the lens of the first camera is located when the first camera obtains a clear image.
303. After the first camera is located at the first position and acquires the clear image, the electronic equipment acquires a first image shot by the first camera and used for displaying.
304. The electronic equipment acquires the current scaling value and cuts the first image according to the current scaling value to obtain a cut first image.
305. And the electronic equipment performs preset processing on the cut first image and displays the processed first image as a display image to a shooting interface.
For example, 302, 303, 304, and 305 may include:
when the electronic device processes an image acquired by the first camera to obtain a preview image, when a lens of the first camera is located at a first position, the electronic device may acquire a first digital-to-analog conversion code value (DAC code) currently corresponding to the first camera. That is, the first camera stays at a clearly focused position after focusing is completed, the clearly focused position corresponds to a digital-to-analog conversion code value, and the electronic device can acquire the digital-to-analog conversion code value and determine the digital-to-analog conversion code value as the first digital-to-analog conversion code value. For example, when an image acquired by the first camera is used for processing to obtain a preview image, each focus of the first camera is completed once, a lens of the first camera stays at a position where the focus is clear, and the electronic device can acquire a first digital-to-analog conversion code value currently corresponding to the first camera.
After the first camera is located at the first position and acquires the clear image, the electronic device may acquire a first image for previewing, which is captured by the first camera. For example, the electronic device may capture a frame of image after each focusing of the first camera is completed, and store the frame of image in the third image buffer queue. Then, the electronic device may obtain the latest stored frame of image from the third image buffer queue and determine the frame of image as the first image. Thereafter, the electronic device may obtain a current scaling value, and crop (e.g., upscale process) the first image according to the current scaling value, thereby obtaining a cropped first image. After the cropped first image is obtained, the electronic device may perform preset processing such as image denoising and image sharpening on the cropped first image, and display the preset processed first image as a preview image in a preview interface for a user to preview.
306. When the scaling value is switched from being smaller than or equal to the preset threshold value to being larger than the preset threshold value, the electronic equipment determines that the camera used for obtaining the display image is switched from the first camera to the second camera, and the first digital-to-analog conversion code value is converted into an object distance value of a focusing object.
307. The electronic device converts the object distance value to a second digital-to-analog converted code value corresponding to the second camera.
308. And according to the second digital-to-analog conversion code value, the electronic equipment drives the second camera to focus, and acquires a second image acquired when the second camera is located at a second position, wherein the second position is the position of a lens of the second camera when the second camera acquires a clear image.
For example, 306, 307, 308 may include:
for example, when a preview image is obtained by processing an image acquired by a first camera, a user performs a slide operation on a preview interface with a finger, the slide operation being used for instructing the electronic device to enlarge the preview image, i.e., the slide operation being used for instructing the electronic device to increase a zoom scale value. In this case, the electronic device may increase the scaling value and detect whether the increased scaling value is greater than a preset threshold.
For example, in this embodiment, the electronic device detects that the increased scaling value is greater than the preset threshold, that is, the value of the scaling value is changed from being smaller than or equal to the preset threshold to being greater than the preset threshold. In this case, the electronic device may determine that the camera used for acquiring the preview image needs to be switched from the first camera to the second camera, and the electronic device may convert the newly acquired first digital-to-analog conversion code value into the object distance value of the focused object.
And then, the electronic equipment can convert the object distance value into a second digital-to-analog conversion code value corresponding to the second camera, drive the second camera to focus according to the second digital-to-analog conversion code value, and acquire a second image acquired when the second camera is located at a second position, wherein the second position is a position where a lens of the second camera is located when the second camera acquires a clear image. For example, after the focusing of the second camera is completed, the electronic device may acquire a second image captured after the focusing of the second camera is completed.
309. The electronic device determines a size and image content of the processed first image.
310. And according to the size and the image content of the processed first image, the electronic equipment performs image cutting on the second image to obtain a cut second image.
311. And the electronic equipment performs preset processing on the cut second image and displays the processed second image as a display image to a shooting interface so as to keep the display images of the shooting interface consistent before and after the camera is switched.
For example, 309, 310, 311 may include:
since the first camera is a standard camera and the second camera is a wide-angle camera, the field angle of the second camera is wider, that is, the scene range of the image shot by the second camera is wider. After acquiring the second image, the electronic device may determine 305 the size and image content of the resulting processed first image. Thereafter, the electronic device may perform image cropping (e.g., crop processing) on the second image according to the size and the image content of the processed first image, thereby obtaining a cropped second image. The size and content of the cropped second image are consistent with the size and content of the processed first image. After that, the electronic device may perform preset processing such as image denoising and image sharpening on the cropped second image, and display the second image subjected to the preset processing as a preview image in a preview interface. It can be understood that, since the object distances of the processed first image and the processed second image are consistent, and the sizes and the contents of the processed second image and the processed first image are consistent, the preview images in the preview interface before and after the camera is switched are also consistent without abrupt change.
It can be understood that, in the embodiment, since the first camera and the second camera both use the phase detection focusing method to perform focusing, and the phase detection focusing has the advantages of fast and accurate focusing speed, the embodiment can enable the preview image in the preview interface to be smoothly switched when the first camera is switched to the second camera.
In one embodiment, for example, some time later, the user performs another sliding operation with a finger on the preview interface, the sliding operation is used for instructing the electronic device to reduce the preview image, and the sliding operation is used for instructing the electronic device to reduce the zoom scale value. In this case, the electronic device may decrease the scaling value and detect whether the decreased scaling value is greater than a preset threshold. For example, the electronic device detects that the reduced scaling value is less than or equal to the preset threshold, i.e., the value of the scaling value changes from being greater than the preset threshold to being less than or equal to the preset threshold. In this case, the electronic device may determine that the camera used for acquiring the preview image needs to be switched from the second camera to the first camera (that is, the electronic device needs to perform the second camera switching), and the electronic device may convert the newly acquired third dac code value into an object distance value of the object to be focused, and convert the object distance value into a fourth dac code value corresponding to the first camera. And the third digital-to-analog conversion code value is a digital-to-analog conversion code value corresponding to the second camera after the last focusing is finished.
Then, the electronic device may drive the first camera to perform focusing according to the fourth dac code value, so as to keep the preview images in the preview interface before and after the second camera switching consistent.
In other embodiments, in addition to the phase detection focusing method, the two cameras of the electronic device may also use a Contrast auto focusing (Contrast auto focusing) method to perform focusing. Of course, the focusing modes of the first camera and the second camera may be one for phase detection focusing and the other for contrast focusing.
In other embodiments, the first camera may be of a type such as a tele camera or a wide camera, in addition to a standard camera. The type of the second camera may be a telephoto camera or the like, in addition to the wide-angle camera. As long as the first camera and the second camera are of different types.
Referring to fig. 6 to 7, fig. 6 to 7 are schematic scene diagrams of an image processing method according to an embodiment of the present application.
For example, the electronic device includes two cameras, one of which is a main camera and the other of which is a super wide-angle camera. The main camera and the ultra-wide angle camera both use a phase detection focusing mode to focus. When the main camera and the super wide-angle camera are in the shooting interface, the main camera and the super wide-angle camera are both in the open state and can shoot images, and the images shot by the main camera and the super wide-angle camera can be stored in the corresponding image buffer queues. But the electronic device only processes the image captured by one of the cameras to obtain the display image.
The electronic device may determine, based on the scaling value, that the video is to be recorded using an image captured using the main camera or the ultra-wide angle camera. For example, when the zoom ratio value is less than or equal to the preset threshold, the electronic device may process the image acquired by the main camera to obtain the display image. When the zoom ratio is larger than the preset threshold, the electronic device may process the image acquired by the ultra-wide-angle camera to obtain a display image. For example, the preset threshold value may have a value of 6.0.
As shown in fig. 6, when the user uses the electronic device to record a video, for example, when the current value of the zoom ratio is smaller than the preset threshold, the electronic device records a video using an image captured by the main camera. Namely, the electronic equipment can store the image shot by the main camera as a video frame. In the process of recording a video by using the main camera, the electronic device can acquire a first digital-to-analog conversion code value (DAC code) currently corresponding to the main camera which performs focusing every time focusing triggered by shooting an image is completed. That is, the lens of the first camera stays at a clearly focused position (e.g., the first position) after focusing is completed, the clearly focused position corresponds to one digital-to-analog conversion code value, and the electronic device may acquire the digital-to-analog conversion code value and determine the digital-to-analog conversion code value as the first digital-to-analog conversion code value. For example, in one embodiment, the first dac value may be a variable used to store the value of the corresponding dac value at the last time the focusing is completed, and the value of the last dac value is overwritten.
Thereafter, for example, as shown in fig. 7, the user performs a slide gesture operation with a finger on the preview interface, the slide gesture operation being used to instruct the electronic apparatus to enlarge the preview image, i.e., the slide gesture operation being used to instruct the electronic apparatus to increase the zoom scale value. In this case, the electronic device may increase the scaling value and detect whether the increased scaling value is greater than a preset threshold.
For example, in this embodiment, the electronic device detects that the increased scaling value is greater than the preset threshold, that is, the value of the scaling value is changed from being smaller than or equal to the preset threshold to being greater than the preset threshold. In this case, the electronic device may determine that the camera used for recording the video needs to be switched from the main camera to the ultra-wide-angle camera, and the electronic device may convert the first dac code value corresponding to the newly stored main camera into the object distance value of the object to be focused.
Then, the electronic device may convert the object distance value into a second digital-to-analog conversion code value corresponding to the super-wide-angle camera, and drive the super-wide-angle camera to focus according to the second digital-to-analog conversion code value. After the super wide-angle camera completes focusing, the electronic equipment can acquire images shot after the super wide-angle camera completes focusing. And then, the electronic equipment can cut the image shot after the super-wide-angle camera focuses according to the size and the content of the frame of image shot by the main camera for recording the video for the last time, so as to obtain the cut image. After performing preset processing such as image denoising and sharpening on the clipped image, the electronic device may display the processed image on a video recording interface and store the processed image as a video frame. It can be understood that, since the size and content of the image obtained by the above processing are consistent with the size and content of the image of the frame which is used for recording the video and is last shot by the main camera, the image of the video recording interface is consistent in the process of camera switching, so that the effect of smooth switching is achieved.
In other embodiments, the image processing method provided by this embodiment may also be applied to a scene in which a moving object is tracked by distance. For example, the electronic device may preset different corresponding relationships between the distance and the scaling value. The correspondence may be that the smaller the distance, the larger the scaling value. For example, electronic devices need to track a moving car. Then, the electronic device may adjust the scaling value according to the distance of the car from the camera. For example, the electronic device may record a video about a moving car using the main camera when the distance corresponds to a zoom value that is less than or equal to a preset threshold. When the zoom ratio corresponding to the distance is greater than the preset threshold, the electronic device may record a video about the moving automobile using the ultra-wide-angle camera.
For example, when the electronic device determines that a camera for recording a video needs to be switched from a main camera to a super-wide-angle camera, and the electronic device may convert a first digital-to-analog conversion code value corresponding to the newly stored main camera into an object distance value of an object to be focused. Then, the electronic device may convert the object distance value into a second digital-to-analog conversion code value corresponding to the super-wide-angle camera, and drive the super-wide-angle camera to focus according to the second digital-to-analog conversion code value. After the super wide-angle camera completes focusing, the electronic equipment can acquire images shot after the super wide-angle camera completes focusing. And then, the electronic equipment can cut the image shot after the super-wide-angle camera focuses according to the size and the content of the frame of image shot by the main camera for recording the video for the last time, so as to obtain the cut image. After performing preset processing such as image denoising and sharpening on the clipped image, the electronic device may display the processed image on a video recording interface and store the processed image as a video frame. It can be understood that, since the size and content of the image obtained by the above processing are consistent with the size and content of the image of the frame which is used for recording the video and is last shot by the main camera, the image of the video recording interface is consistent in the process of camera switching, so that the effect of smooth switching is achieved. After the video recording interface images are smoothly switched due to the switching of the cameras, the electronic equipment can automatically focus and record videos by using the super-wide-angle camera without focusing according to the last frame of image recorded by the main camera.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present disclosure. The image processing apparatus can be applied to an electronic device including at least two cameras, the two cameras being different in type. The image processing apparatus 400 may include: the device comprises an acquisition module 401, a first conversion module 402, a second conversion module 403 and a driving module 404.
The obtaining module 401 is configured to obtain a first digital-to-analog conversion code value currently corresponding to the first camera when the two cameras are both in an open state and a lens of the first camera is located at a first position, where the lens of the first camera is located when the first camera obtains a clear image.
A first conversion module 402, configured to convert the first dac code value into an object distance value of an object in focus.
A second conversion module 403, configured to convert the object distance value into a second digital-to-analog conversion code value corresponding to the second camera.
And a driving module 404, configured to drive the second camera to perform focusing according to the second digital-to-analog conversion code value.
In one embodiment, when the electronic device is in a shooting interface, both cameras of the electronic device acquire images, and the electronic device processes the images acquired by one camera to obtain a display image, where the display image is an image for displaying on the shooting interface.
The obtaining module 401 may be configured to: when the two cameras are both in an open state, the electronic equipment acquires a display image by using a first camera, and a lens of the first camera is located at a first position, a first digital-to-analog conversion code value currently corresponding to the first camera is acquired.
The first conversion module 402 may be configured to: when the camera used for acquiring the display image is switched from the first camera to the second camera, converting the first digital-to-analog conversion code value into an object distance value of a focusing object;
the driver module 404 may be configured to: and driving the second camera to focus according to the second digital-to-analog conversion code value so as to keep the display images of the shooting interface consistent before and after the camera is switched.
In one embodiment, the electronic device determines a camera for acquiring a display image according to a scaling value; when the scaling value is smaller than or equal to a preset threshold value, the electronic equipment utilizes the image acquired by one camera to process to obtain a display image; and when the scaling value is larger than the preset threshold value, the electronic equipment processes the image acquired by the other camera to obtain a display image.
Then, the first conversion module 402 may be configured to: when the zoom ratio value is switched from being smaller than or equal to a preset threshold value to being larger than the preset threshold value, or the zoom ratio value is switched from being larger than the preset threshold value to being smaller than or equal to the preset threshold value, it is determined that a camera used for obtaining a display image is switched from a first camera to a second camera, and the first digital-to-analog conversion code value is converted into an object distance value of a focusing object.
In one embodiment, the type of the first camera and the second camera is one of a standard camera, a wide-angle camera, and a telephoto camera, and the type of the first camera and the second camera are different.
In an embodiment, the obtaining module 401 may further be configured to:
after the first camera is located at the first position and obtains a clear image, obtaining a first image shot by the first camera and used for displaying;
acquiring a current scaling value;
according to the current scaling value, the first image is cut to obtain a cut first image;
and performing preset processing on the cut first image, and displaying the processed first image as a display image to a shooting interface.
In one embodiment, the first camera is a standard camera and the second camera is a wide angle camera.
The driver module 404 may be configured to:
driving the second camera to focus, and acquiring a second image acquired when the second camera is located at a second position, wherein the second position is a position where a lens of the second camera is located when the second camera acquires a clear image;
determining the size and image content of the processed first image;
according to the size and the image content of the processed first image, performing image cutting on the second image to obtain a cut second image;
and performing preset processing on the cut second image, and displaying the processed second image as a display image to a shooting interface so as to keep the display images of the shooting interface consistent before and after the camera is switched.
In one embodiment, the two cameras of the electronic device perform focusing by using a phase detection focusing method, or perform focusing by using a contrast focusing method.
In one embodiment, the shooting interface is a preview interface or a video recording interface.
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, which, when executed on a computer, causes the computer to execute the flow in the image processing method provided by this embodiment.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the flow in the image processing method provided in this embodiment by calling the computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
The electronic device 500 may include a camera unit 501, a memory 502, a processor 503, and the like. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 9 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The camera unit 501 may comprise at least two cameras, which are of different types.
The memory 502 may be used to store applications and data. Memory 502 stores applications containing executable code. The application programs may constitute various functional modules. The processor 503 executes various functional applications and data processing by running an application program stored in the memory 502.
The processor 503 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 502 and calling the data stored in the memory 502, thereby performing overall monitoring of the electronic device.
In this embodiment, the processor 503 in the electronic device loads the executable code corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 503 runs the application programs stored in the memory 502, so as to execute:
when the two cameras are both in an open state and a lens of a first camera is located at a first position, acquiring a first digital-to-analog conversion code value currently corresponding to the first camera, wherein the first position is the position where the lens of the first camera is located when the first camera acquires a clear image;
converting the first digital-to-analog conversion code value into an object distance value of a focusing object;
converting the object distance value into a second digital-to-analog conversion code value corresponding to a second camera;
and driving the second camera to focus according to the second digital-to-analog conversion code value.
Referring to fig. 10, the electronic apparatus 500 may include a camera unit 501, a memory 502, a processor 503, an input unit 504, an output unit 505, a speaker 506, and the like.
The camera unit 501 may comprise at least two cameras, which are of different types.
Each camera may include image processing circuitry. The Image Processing circuitry may be implemented using hardware and/or software components and may include various Processing units that define an Image Signal Processing (Image Signal Processing) pipeline. The image processing circuit may include at least: a camera, an Image Signal Processor (ISP Processor), control logic, an Image memory, and a display. Wherein the camera may comprise at least one or more lenses and an image sensor. The image sensor may include an array of color filters (e.g., Bayer filters). The image sensor may acquire light intensity and wavelength information captured with each imaging pixel of the image sensor and provide a set of raw image data that may be processed by an image signal processor.
The image signal processor may process the raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and the image signal processor may perform one or more image processing operations on the raw image data, gathering statistical information about the image data. Wherein the image processing operations may be performed with the same or different bit depth precision. The raw image data can be stored in an image memory after being processed by an image signal processor. The image signal processor may also receive image data from an image memory.
The image Memory may be part of a Memory device, a storage device, or a separate dedicated Memory within the electronic device, and may include a DMA (Direct Memory Access) feature.
When image data is received from the image memory, the image signal processor may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to an image memory for additional processing before being displayed. The image signal processor may also receive processed data from the image memory and perform image data processing on the processed data in the raw domain and in the RGB and YCbCr color spaces. The processed image data may be output to a display for viewing by a user and/or further processed by a Graphics Processing Unit (GPU). Further, the output of the image signal processor may also be sent to an image memory, and the display may read image data from the image memory. In one embodiment, the image memory may be configured to implement one or more frame buffers.
The statistical data determined by the image signal processor may be sent to the control logic. For example, the statistical data may include statistical information of the image sensor such as auto exposure, auto white balance, auto focus, flicker detection, black level compensation, lens shading correction, and the like.
The control logic may include a processor and/or microcontroller that executes one or more routines (e.g., firmware). One or more routines may determine camera control parameters and ISP control parameters based on the received statistics. For example, the control parameters of the camera may include camera flash control parameters, control parameters of the lens (e.g., focal length for focusing or zooming), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (e.g., during RGB processing), etc.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an image processing circuit in the present embodiment. As shown in fig. 11, for convenience of explanation, only aspects of the image processing technique related to the embodiment of the present invention are shown.
For example, the image processing circuitry may include: camera, image signal processor, control logic ware, image memory, display. The camera may include one or more lenses and an image sensor, among others.
And the first image collected by the camera is transmitted to an image signal processor for processing. After the image signal processor processes the first image, statistical data of the first image (e.g., brightness of the image, contrast value of the image, color of the image, etc.) may be sent to the control logic. The control logic device can determine the control parameters of the camera according to the statistical data, so that the camera can carry out operations such as automatic focusing and automatic exposure according to the control parameters. The first image can be stored in the image memory after being processed by the image signal processor. The image signal processor may also read the image stored in the image memory for processing. In addition, the first image can be directly sent to the display for displaying after being processed by the image signal processor. The display may also read the image in the image memory for display.
In addition, not shown in the figure, the electronic device may further include a CPU and a power supply module. The CPU is connected with the logic controller, the image signal processor, the image memory and the display, and is used for realizing global control. The power supply module is used for supplying power to each module.
The memory 502 may be used to store applications and data. Memory 502 stores applications containing executable code. The application programs may constitute various functional modules. The processor 503 executes various functional applications and data processing by running an application program stored in the memory 502.
The processor 503 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 502 and calling the data stored in the memory 502, thereby performing overall monitoring of the electronic device.
The input unit 504 may be used to receive input numbers, character information, or user characteristic information (such as a fingerprint), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The output unit 505 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. The output unit may include a display panel.
In this embodiment, the processor 503 in the electronic device loads the executable code corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 503 runs the application programs stored in the memory 502, so as to execute:
when the two cameras are both in an open state and a lens of a first camera is located at a first position, acquiring a first digital-to-analog conversion code value currently corresponding to the first camera, wherein the first position is the position where the lens of the first camera is located when the first camera acquires a clear image;
converting the first digital-to-analog conversion code value into an object distance value of a focusing object;
converting the object distance value into a second digital-to-analog conversion code value corresponding to a second camera;
and driving the second camera to focus according to the second digital-to-analog conversion code value.
In one embodiment, when the electronic device is in a shooting interface, both cameras of the electronic device acquire images, and the electronic device processes the images acquired by one camera to obtain a display image, where the display image is an image for displaying on the shooting interface.
Then, the processor 503 may execute, when the two cameras are both in the on state and the lens of the first camera is located at the first position, acquiring a first digital-to-analog conversion code value currently corresponding to the first camera, that: when the two cameras are both in an open state, the electronic equipment acquires a display image by using a first camera, and a lens of the first camera is located at a first position, a first digital-to-analog conversion code value currently corresponding to the first camera is acquired.
When the processor 503 performs the conversion of the first dac code value into the object distance value of the focused object, it may perform: and when the camera used for acquiring the display image is switched from the first camera to the second camera, converting the first digital-to-analog conversion code value into an object distance value of a focusing object.
The processor 503 may execute, when driving the second camera to focus according to the second digital-to-analog conversion code value, the following steps: and driving the second camera to focus according to the second digital-to-analog conversion code value so as to keep the display images of the shooting interface consistent before and after the camera is switched.
In one embodiment, the electronic device determines a camera for acquiring a display image according to a scaling value; when the scaling value is smaller than or equal to a preset threshold value, the electronic equipment utilizes the image acquired by one camera to process to obtain a display image; when the scaling value is larger than the preset threshold value, the electronic equipment utilizes the image acquired by the other camera to process to obtain a display image;
then, the processor 503 may perform the following steps when the camera for acquiring the display image is switched from the first camera to the second camera and the first dac code value is converted into an object distance value of the focused object: when the zoom ratio value is switched from being smaller than or equal to a preset threshold value to being larger than the preset threshold value, or the zoom ratio value is switched from being larger than the preset threshold value to being smaller than or equal to the preset threshold value, it is determined that a camera used for obtaining a display image is switched from a first camera to a second camera, and the first digital-to-analog conversion code value is converted into an object distance value of a focusing object.
In one embodiment, the type of the first camera and the second camera is one of a standard camera, a wide-angle camera, and a telephoto camera, and the type of the first camera and the second camera are different.
In one embodiment, the processor 503 may further perform: after the first camera is located at the first position and obtains a clear image, obtaining a first image shot by the first camera and used for displaying; acquiring a current scaling value; according to the current scaling value, the first image is cut to obtain a cut first image; and performing preset processing on the cut first image, and displaying the processed first image as a display image to a shooting interface.
In one embodiment, the first camera is a standard camera and the second camera is a wide angle camera.
Then, the processor 503 drives the second camera to perform focusing so that the display images of the shooting interfaces before and after the camera is switched are consistent, and may perform: driving the second camera to focus, and acquiring a second image acquired when the second camera is located at a second position, wherein the second position is a position where a lens of the second camera is located when the second camera acquires a clear image; determining the size and image content of the processed first image; according to the size and the image content of the processed first image, performing image cutting on the second image to obtain a cut second image; and performing preset processing on the cut second image, and displaying the processed second image as a display image to a shooting interface so as to keep the display images of the shooting interface consistent before and after the camera is switched.
In one embodiment, the two cameras of the electronic device perform focusing by using a phase detection focusing method, or perform focusing by using a contrast focusing method.
In one embodiment, the shooting interface is a preview interface or a video recording interface.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the image processing method, and are not described herein again.
The image processing apparatus provided in the embodiment of the present application and the image processing method in the above embodiment belong to the same concept, and any method provided in the embodiment of the image processing method may be run on the image processing apparatus, and a specific implementation process thereof is described in the embodiment of the image processing method in detail, and is not described herein again.
It should be noted that, for the image processing method described in the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process of implementing the image processing method described in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and during the execution, the process of the embodiment of the image processing method can be included. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the image processing apparatus according to the embodiment of the present application, each functional module may be integrated into one processing chip, each module may exist alone physically, or two or more modules may be integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The foregoing detailed description has provided an image processing method, an image processing apparatus, a storage medium, and an electronic device according to embodiments of the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the foregoing embodiments are only used to help understand the method and the core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. An image processing method applied to an electronic device, wherein the electronic device comprises at least two cameras, and the two cameras are different in type, and the image processing method comprises the following steps:
when the electronic equipment is in a shooting interface, controlling a first camera and a second camera to be in an open state, wherein both the two cameras of the electronic equipment can acquire images, the electronic equipment utilizes the image acquired by one camera to process to obtain a display image, and the display image is an image displayed on the shooting interface;
when a display image is obtained by the first camera and a lens of the first camera is located at a first position, obtaining a first digital-to-analog conversion code value currently corresponding to the first camera, wherein the first position is the position where the lens of the first camera is located when the first camera obtains a clear image;
when the camera used for acquiring the display image is switched from the first camera to the second camera, converting the first digital-to-analog conversion code value into an object distance value of a focusing object;
converting the object distance value into a second digital-to-analog conversion code value corresponding to a second camera;
and driving the second camera to focus according to the second digital-to-analog conversion code value so as to keep the display images of the shooting interface consistent before and after the camera is switched.
2. The image processing method according to claim 1, wherein the electronic device determines a camera for acquiring the display image according to the scaling value; when the scaling value is smaller than or equal to a preset threshold value, the electronic equipment utilizes the image acquired by one camera to process to obtain a display image; when the scaling value is larger than the preset threshold value, the electronic equipment utilizes the image acquired by the other camera to process to obtain a display image;
when the camera used for acquiring the display image is switched from the first camera to the second camera, the first digital-to-analog conversion code value is converted into an object distance value of a focusing object, and the method comprises the following steps:
when the zoom ratio value is switched from being smaller than or equal to a preset threshold value to being larger than the preset threshold value, or the zoom ratio value is switched from being larger than the preset threshold value to being smaller than or equal to the preset threshold value, it is determined that a camera used for obtaining a display image is switched from a first camera to a second camera, and the first digital-to-analog conversion code value is converted into an object distance value of a focusing object.
3. The image processing method according to claim 1, wherein the type of the first camera and the second camera is one of a standard camera, a wide camera, and a tele camera, and the type of the first camera and the second camera are different.
4. The image processing method according to claim 1, characterized in that the method further comprises:
after the first camera is located at the first position and obtains a clear image, obtaining a first image shot by the first camera and used for displaying;
acquiring a current scaling value;
according to the current scaling value, the first image is cut to obtain a cut first image;
and performing preset processing on the cut first image, and displaying the processed first image as a display image to a shooting interface.
5. The image processing method of claim 4, wherein the first camera is a standard camera and the second camera is a wide-angle camera;
the driving the second camera to focus so that the display images of the shooting interface are kept consistent before and after the camera is switched, comprising:
driving the second camera to focus, and acquiring a second image acquired when the second camera is located at a second position, wherein the second position is a position where a lens of the second camera is located when the second camera acquires a clear image;
determining the size and image content of the processed first image;
according to the size and the image content of the processed first image, performing image cutting on the second image to obtain a cut second image;
and performing preset processing on the cut second image, and displaying the processed second image as a display image to a shooting interface so as to keep the display images of the shooting interface consistent before and after the camera is switched.
6. The method according to claim 1, wherein the two cameras of the electronic device focus using phase detection, or the two cameras of the electronic device focus using contrast focusing.
7. The image processing method according to claim 1, wherein the shooting interface is a preview interface or a video recording interface.
8. An image processing device is applied to electronic equipment and is characterized in that the electronic equipment comprises at least two cameras, the types of the two cameras are different, when the two cameras are positioned in a shooting interface, a first camera and a second camera are both in an open state, wherein the two cameras of the electronic equipment can acquire images, the electronic equipment utilizes the image acquired by one camera to process to obtain a display image, and the display image is an image displayed on the shooting interface; the image processing apparatus includes:
the acquisition module is used for acquiring a first digital-to-analog conversion code value currently corresponding to the first camera when the first camera is used for acquiring a display image and the lens of the first camera is located at a first position, wherein the first position is the position where the lens of the first camera is located when the first camera acquires a clear image;
the first conversion module is used for converting the first digital-to-analog conversion code value into an object distance value of a focusing object when a camera used for acquiring a display image is switched from the first camera to a second camera;
the second conversion module is used for converting the object distance value into a second digital-to-analog conversion code value corresponding to a second camera;
and the driving module is used for driving the second camera to focus according to the second digital-to-analog conversion code value so as to keep the display images of the shooting interface consistent before and after the camera is switched.
9. A storage medium having stored thereon a computer program, the computer program, when executed on a computer, causing the computer to perform the method of any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor and at least two cameras, wherein the two cameras are of different types, the processor being configured to execute the method according to any one of claims 1 to 7 by calling a computer program stored in the memory.
CN201910878358.7A 2019-09-03 2019-09-03 Image processing method, image processing device, storage medium and electronic equipment Active CN110691192B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910878358.7A CN110691192B (en) 2019-09-03 2019-09-03 Image processing method, image processing device, storage medium and electronic equipment
PCT/CN2020/111770 WO2021043061A1 (en) 2019-09-03 2020-08-27 Image processing method and apparatus, and storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910878358.7A CN110691192B (en) 2019-09-03 2019-09-03 Image processing method, image processing device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110691192A CN110691192A (en) 2020-01-14
CN110691192B true CN110691192B (en) 2021-04-13

Family

ID=69109382

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910878358.7A Active CN110691192B (en) 2019-09-03 2019-09-03 Image processing method, image processing device, storage medium and electronic equipment

Country Status (2)

Country Link
CN (1) CN110691192B (en)
WO (1) WO2021043061A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110691192B (en) * 2019-09-03 2021-04-13 RealMe重庆移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN111246093B (en) * 2020-01-16 2021-07-20 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
EP3869788A1 (en) * 2020-02-19 2021-08-25 Ricoh Company, Ltd. Image capturing device, image communication system, method for display control, and carrier means
CN113438407B (en) * 2020-03-23 2022-10-04 华为技术有限公司 Multi-camera module focusing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104363379A (en) * 2014-11-28 2015-02-18 广东欧珀移动通信有限公司 Shooting method by use of cameras with different focal lengths and terminal
CN105959553A (en) * 2016-05-30 2016-09-21 维沃移动通信有限公司 Camera switching method and terminal
CN106341612A (en) * 2016-11-29 2017-01-18 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN108234876A (en) * 2018-01-22 2018-06-29 努比亚技术有限公司 A kind of tracking focusing method, terminal and computer readable storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4198449B2 (en) * 2002-02-22 2008-12-17 富士フイルム株式会社 Digital camera
US9538096B2 (en) * 2014-01-27 2017-01-03 Raytheon Company Imaging system and methods with variable lateral magnification
CN106556961A (en) * 2015-09-30 2017-04-05 佳能企业股份有限公司 Camera head and its method of operating
CN106341611A (en) * 2016-11-29 2017-01-18 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN106412445A (en) * 2016-11-29 2017-02-15 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN106559528A (en) * 2016-11-29 2017-04-05 广东欧珀移动通信有限公司 Control method, control device and electronic installation
CN110691192B (en) * 2019-09-03 2021-04-13 RealMe重庆移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104363379A (en) * 2014-11-28 2015-02-18 广东欧珀移动通信有限公司 Shooting method by use of cameras with different focal lengths and terminal
CN105959553A (en) * 2016-05-30 2016-09-21 维沃移动通信有限公司 Camera switching method and terminal
CN106341612A (en) * 2016-11-29 2017-01-18 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN108234876A (en) * 2018-01-22 2018-06-29 努比亚技术有限公司 A kind of tracking focusing method, terminal and computer readable storage medium

Also Published As

Publication number Publication date
WO2021043061A1 (en) 2021-03-11
CN110691192A (en) 2020-01-14

Similar Documents

Publication Publication Date Title
US10412298B2 (en) Control method, control device and electronic device
CN110691192B (en) Image processing method, image processing device, storage medium and electronic equipment
CN110505411B (en) Image shooting method and device, storage medium and electronic equipment
US9578260B2 (en) Digital photographing apparatus and method of controlling the digital photographing apparatus
US8885061B2 (en) Image processing apparatus, image processing method and program
US9549126B2 (en) Digital photographing apparatus and control method thereof
KR20110020522A (en) Method and apparatus for controlling zoom using touch screen
GB2487456A (en) High speed video capture using different frame rates
JP2011259285A (en) Imaging apparatus
JP2009273023A (en) Imaging device, imaging method, focusing control method, and program
CN115280756B (en) Method and device for adjusting zoom setting of digital camera and readable storage medium
CN111246093B (en) Image processing method, image processing device, storage medium and electronic equipment
JP2006339784A (en) Imaging apparatus, image processing method, and program
CN111246092B (en) Image processing method, image processing device, storage medium and electronic equipment
KR101038815B1 (en) Image capture system capable of fast auto focus
JP6116436B2 (en) Image processing apparatus and image processing method
CN111212231B (en) Image processing method, image processing device, storage medium and electronic equipment
CN113837937A (en) Multimedia processing chip, electronic equipment image fusion method and image cutting method
JP5182395B2 (en) Imaging apparatus, imaging method, and imaging program
JP5455485B2 (en) Imaging device
US10284783B2 (en) Imaging apparatus and control method of imaging apparatus
JP2008067136A (en) Imaging device and imaging method
CN106464783B (en) Image pickup control apparatus, image pickup apparatus, and image pickup control method
US11310442B2 (en) Display control apparatus for displaying image with/without a frame and control method thereof
US20220217285A1 (en) Image processing device, image processing method, and recording medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant